VoiceMode

@Composable
fun VoiceMode(controller: ChatController, onClose: () -> Unit, modifier: Modifier = Modifier, locale: Locale? = null, speech: SpeechOutputState = LocalSpeechOutput.current ?: rememberSpeechOutputState(), listening: SpeechInputState = rememberSpeechInputState())(source)

A hands-free voice conversation over any chat, like the assistant apps' voice mode: it listens (platform speech recognition), sends what the user said to controller, reads the reply aloud sentence by sentence while it streams (platform text-to-speech), then listens again.

Tap the persona to interrupt: it stops reading (or stops the reply being generated) and listens. The microphone can be muted. When the agent needs the user — a tool approval or a question — voice mode pauses and offers to go back to the chat (onClose), where the approval or form is.

Works with every backend: it only uses ChatController and the platform speech engines, so no protocol is involved. The host app must declare RECORD_AUDIO.