Skip to main content

resolve_mic_element

Function resolve_mic_element 

Source
pub fn resolve_mic_element(
    native_id: &str,
) -> Option<(&'static str, &'static str)>
Expand description

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.

OSElementProperty
macOSosxaudiosrcunique-id
Linuxpulsesrcdevice
Windowswasapisrcdevice

On macOS the string device-selection prop is unique-id, NOT device-uid — the latter is not a property of osxaudiosrc and makes gst-launch-1.0 reject the pipeline with zero bytes of audio output, which the mic worker observes as EndOfStream on the first read.