Expand description
GStreamer audio capture (M-MEDIA.5 / AUT-101) — CLI-pipe pattern.
Spawns gst-launch-1.0 with a pipeline that emits normalized
F32LE raw audio on stdout, then chunks the byte stream into
AudioChunks.
§Two source modes
GstreamerAudioCapture::test_source(format, freq_hz)
→ audiotestsrc wave=sine freq=F
! audioconvert
! audioresample
! audio/x-raw,format=F32LE,rate=R,channels=C
! fdsink fd=1
GstreamerAudioCapture::from_file(path, format)
→ filesrc location=PATH
! decodebin
! audioconvert
! audioresample
! audio/x-raw,format=F32LE,rate=R,channels=C
! fdsink fd=1test_source is the AUT-101 deliverable. from_file is the
companion fixture path used by M-MEDIA.8+ integration tests so the
histogram + waveform code runs against real audio without
depending on a microphone.
§Lifecycle
Drop kills the child + waits — without this, gst-launch-1.0
keeps decoding into a dropped pipe and burns CPU. Matches the
decode::GstreamerPipeStream pattern.
Structs§
- Gstreamer
Audio Capture - Streaming audio capture wrapping a
gst-launch-1.0child process.
Enums§
- Error
- Failure modes for the GStreamer audio capture pipe.
Functions§
- caps_
string 🔒 - resolve_
mic_ element - Pick the per-OS gst element + property name that takes the
device’s native identifier (M-MIC.3 / AUT-284). Returns
Nonewhennative_idis empty OR when the current target OS isn’t one we know an element name for — callers fall back toautoaudiosrcin that case.