{"record":{"id":"cde357c8dacbdf8e","repo":"Kuberwastaken/claurst","slug":"no-microphone-found-connect-a-microphone-and-chec","errorCode":null,"errorMessage":"No microphone found. Connect a microphone and check your audio settings.","messagePattern":"No microphone found\\. Connect a microphone and check your audio settings\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/tui/src/voice_capture.rs","lineNumber":84,"sourceCode":"    /// On success a `RecordingStarted` notification is sent over `event_tx`.\r\n    /// Returns an error when no microphone is available or the `voice` feature\r\n    /// is not compiled in.\r\n    pub fn start_recording(\r\n        &mut self,\r\n        event_tx: tokio::sync::mpsc::Sender<VoiceEvent>,\r\n    ) -> anyhow::Result<()> {\r\n        if self.capture.is_some() {\r\n            // Already recording — no-op.\r\n            return Ok(());\r\n        }\r\n\r\n        #[cfg(feature = \"voice\")]\r\n        {\r\n            use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};\r\n\r\n            let host = cpal::default_host();\r\n            let device = host.default_input_device().ok_or_else(|| {\r\n                anyhow::anyhow!(\r\n                    \"No microphone found. Connect a microphone and check your audio settings.\"\r\n                )\r\n            })?;\r\n\r\n            let supported_cfg = device.default_input_config()?;\r\n            let sample_rate = supported_cfg.sample_rate().0;\r\n            let channels = supported_cfg.channels() as usize;\r\n\r\n            let samples: Arc<Mutex<Vec<f32>>> = Arc::new(Mutex::new(Vec::new()));\r\n            let samples_cb = samples.clone();\r\n\r\n            let stream_cfg: cpal::StreamConfig = supported_cfg.into();\r\n            let stream = device.build_input_stream(\r\n                &stream_cfg,\r\n                move |data: &[f32], _: &cpal::InputCallbackInfo| {\r\n                    let mut buf = samples_cb.lock().unwrap();\r\n                    if channels == 1 {\r\n                        buf.extend_from_slice(data);\r","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/tui/src/voice_capture.rs#L66-L102","documentation":"Voice capture start failed because no microphone/input device is available from the default cpal audio host — device enumeration found no input device, or the default input device could not be opened. Environment-level: the machine has no mic or it is disabled/exclusively held.","triggerScenarios":"Thrown at src-rust/crates/tui/src/voice_capture.rs:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Connect or enable a microphone and check OS audio settings","Close other applications holding the input device exclusively","Verify the default input device is set in OS settings"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}