Skip to main content

Module gstreamer_audio

Module gstreamer_audio 

Source
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=1

test_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§

GstreamerAudioCapture
Streaming audio capture wrapping a gst-launch-1.0 child 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 None when native_id is empty OR when the current target OS isn’t one we know an element name for — callers fall back to autoaudiosrc in that case.