Skip to main content
RunAnywhere.voice assembles speech-to-text, a language model, and text-to-speech into one session that listens, thinks, and answers out loud. It owns the microphone while it runs.

Signature

Web takes a single options object, where Swift and Kotlin take named parameters.
Leaving vad unset ensures the catalogued default Silero VAD.

VoiceSession

say speaks a line without waiting for the user, which is how you greet someone. interrupt cuts off whatever is being spoken. Always close() the session. It holds the microphone, and the browser keeps the recording indicator lit until you do.

Turn handling

Raise interruption.minDurationMs in a noisy room, or a cough cuts the model off.

Steering the replies

Spoken replies want to be short. Cap maxOutputTokens lower than you would for a chat interface.

A complete session

Starting from a click is required: the browser will not grant the microphone, or start audio output, without a user gesture. Closing on pagehide is what stops the session surviving a navigation.

Three models at once

A voice session holds a speech model, a language model, and a synthesis model in memory together. In a browser tab that is a real constraint. Prefer the smallest usable model for each, and check the total download size before offering the feature.

Diarization

To answer “who spoke when” over a recording rather than run a live conversation: