Kuberwastaken/claurst · error
Voice capture is not available in this build. Recompile…
Error message
Voice capture is not available in this build. Recompile with --features voice to enable microphone access.
What it means
Compile-time feature guard: start_recording was called in a build without the `voice` feature, so the cpal microphone code is not compiled in and the request is unconditionally rejected. Not a runtime failure — the binary lacks the capability by build configuration.
Solutions
- Rebuild with --features voice to enable microphone capture
- Use a build of the TUI that ships the voice feature
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src-rust/crates/tui/src/voice_capture.rs:138 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10).
Data as JSON: /api/errors/8b42641fb4c1a6ea.
Report an issue: GitHub.
Appendix: source
Thrown at src-rust/crates/tui/src/voice_capture.rs:138
samples,
sample_rate,
stream,
});
// Fire-and-forget: send the event on a background task so we don't
// need an async context here.
let tx = event_tx.clone();
tokio::spawn(async move {
let _ = tx.send(VoiceEvent::RecordingStarted).await;
});
Ok(())
}
#[cfg(not(feature = "voice"))]
{
let _ = event_tx;
Err(anyhow::anyhow!(
"Voice capture is not available in this build. \
Recompile with --features voice to enable microphone access."
))
}
}
/// Stop the capture stream and return the accumulated samples.
///
/// Returns `(samples, sample_rate)`. The sample buffer is empty when no
/// recording was in progress.
pub fn stop_recording(&mut self) -> (Vec<f32>, u32) {
match self.capture.take() {
Some(cap) => {
// Dropping `cap.stream` stops the cpal callback.
let rate = cap.sample_rate;
let samples = cap.samples.lock().unwrap().clone();
(samples, rate)
}
View on GitHub (pinned to b0637c97ec)