Expand description
<MicPicker /> — live-data dropdown selector for microphones in
the Recorder surface (M-MIC.2 / AUT-279).
Mirror of crate::camera_picker for the audio path. Combines
the M-MIC.1 IPC helpers with the storybook CaptureSourceRow +
DevicePickerMenu shapes (M-UI.8 / AUT-128) to provide:
- On mount: invoke
microphone_permission_status+list_microphonesto seed the picker. - On open: re-fetch so newly-plugged USB mics + paired Bluetooth headsets appear.
- On select: invoke
start_mic_capture(mic_id)+ persist the selection toLocalStorageso re-opens land on the same mic. - Permission-denied state uses the same three-state contract as
the camera picker (
Granted/NotDetermined/Denied). - Auto-start on first mount is opt-in via a
MicLifecycle::Idle → Startingguard. Unlike the camera path (which auto-starts the preview to make the canvas alive), the mic worker only starts on explicit user click — recording from the mic without the user asking would be surprising even for a default mic.
M-MIC.1's worker uses `autoaudiosrc`, which always opens the OS
default mic regardless of the `mic_id` we send. The picker UX
still works — `start_mic_capture(mic_id)` is the IPC contract —
but the OS-default-only behaviour means clicking a non-default
mic doesn't yet switch the active input. Per-mic wiring
(`osxaudiosrc device-uid=…` etc.) is a follow-up that's a
drop-in extension to the worker's pipeline args; no UI changes
needed.Structs§
- MicPicker
Body 🔒Props - Props for the
MicPickerBodycomponent. - MicPicker
Props - Props for the
MicPickercomponent.
Functions§
- MicPicker
<MicPicker />— live mic picker rendered alongside the camera picker in the Recorder surface.- MicPicker
Body 🔒 - Required Props
- format_
channels 🔒 - format_
sample_ 🔒rate - format_
subline 🔒 - Build the per-row “48 kHz · stereo · default” subline.
0values forchannels/sample_rate_hz(the “unknown” sentinel from M-MIC.0) are omitted entirely rather than rendered as “0 Hz / 0ch” noise. - read_
last_ 🔒used - refresh_
microphones 🔒 - render_
row 🔒 - resolve_
default 🔒 - Resolve which mic should be selected on initial mount:
- selected_
label 🔒 - write_
last_ 🔒used