maybe_run_capture_subprocess (src/lib.rs)

grok-build · crates/codegen/xai-grok-voice/src/lib.rs · rust · Apache-2.0
voice

Runs hidden mic-capture subprocess for voice input, handling re-exec logic.

// Source: https://github.com/xai-org/grok-build | License: Apache-2.0 | Copyright 2023-2026 SpaceXAI
// Provided via justclaw.it.com; keep this notice with the code.
//! Voice input for Grok Build CLI: an xAI streaming STT client and the [`run_voice_pipeline`] task that emits [`VoiceEvent`]s for the pager.
//!
//! Voice is dictation only: the mic streams to STT and the transcript lands in the prompt box.
//!
//! On macOS and Linux the mic is opened in a short-lived subprocess, so the long-lived TUI never pays the audio stack's permanent memory cost.
//! See [`audio`] and [`maybe_run_capture_subprocess`].

#![deny(clippy::indexing_slicing)]

#[cfg(feature = "audio")]
pub mod audio;
pub mod auth;
// The clip route only runs with capture compiled in; its tests need no device.
#[cfg(any(test,

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key