/v2/room takes the mixed audio of a meeting room or call, separates up to 8 voices, transcribes each voice on its own, and reports turn events for the room as a whole.
A room also works for a single caller. Use one when you want Baton's transcript of what your caller said alongside the turn events. Room transcripts can miss an isolated one-word answer, so for short answers rely on expect and hint, which are built for them.
Start a room
A room takes the same session.start options as the streams: eot, language, signals, keywords, echo, idle_timeout_s, messages.
{
"type": "session.start",
"api_key": "baton_...",
"eot": {"profile": "cutoff_5pct"},
"language": {"allowed": ["en", "es", "fr"]},
"signals": ["vad", "bargein", "partials"]
}
Tell Baton the languages people may speak. Transcripts are better when it knows, and a list of several is better than nothing (Languages).
Then send the mixed audio as binary frames, exactly as on the stream endpoints.
Choosing what you receive
Every room receives session.started, the turn events (turn.end, turn.resumed, turn.answer, turn.hint), asr.final, asr.flushed, warning and session.summary. Add to signals for more:
| Name | Adds |
|---|---|
vad |
vad.start, vad.end for the room |
bargein |
bargein.onset, bargein.class |
partials |
asr.partial: each voice's words while they may still change |
language |
asr.language, language.switched, language.switch_recommended, language.summary |
What you ask for changes only what you are sent, never the turns or the transcript. What each event means and what to do with it: Events.
Modes
mode is optional. It only sets the default operating point, used when session.start has no eot; an eot always wins. Valid values:
mode |
Default operating point | Mean latency (English) |
|---|---|---|
transactional_call (used when mode is omitted) |
cutoff_10pct |
317 ms |
working_session |
cutoff_5pct |
563 ms |
one_on_one |
cutoff_5pct |
563 ms |
brainstorm |
cutoff_2pct |
861 ms |
formal |
cutoff_2pct |
861 ms |
Rooms use the same operating points as /v2/stream. Any other mode is refused with 1008 unknown mode (one of ...).
Transcripts
Each voice is named spk_0 to spk_7 in order of first appearance, and keeps its name for the session. asr.partial needs partials in signals.
{"type": "asr.partial", "seq": 2, "t": 3.2,
"speaker": "spk_1", "text": "I", "language": "en"}
{"type": "asr.final", "seq": 4, "t": 3.52,
"speaker": "spk_1", "text": "I never", "t0": 3.2,
"t1": 3.52, "language": "en"}
asr.partialcarries a voice's newest word or words, which may still change. Each partial replaces the previous one for that voice.asr.finalcarries words that will not change. Append them to that voice's transcript.- A word becomes final as soon as the speaker says another word, after about a second without change, or when you send
finalize. t0andt1are when the first and last of the final words were first heard.
Cutting segments at turn boundaries
Turn events in a room use speaker: "room". When your own logic decides a speaker has finished, send finalize:
{"type": "finalize"}
Baton sends each voice's pending word as asr.final, then asr.flushed. Cut your segments on asr.flushed. Otherwise a speaker's last word can arrive after you have cut, splitting "Saint" from "Paul".
Ending
Send session.end. Baton sends the remaining finals, a language.summary (seconds of speech per voice per language; with language in signals), session.summary (audio_s, turns), then closes with 1000.
Barge-in and idle sessions
Both work as on the streams. Send agent.speech start and end while your agent talks, with bargein in signals, to get bargein.onset and bargein.class when anyone in the room speaks over your agent. With text or words on agent.speech, a stop someone says over your agent's own "stop" is still acted on (confirmed_by: "two_speakers"), and someone talking during your agent's echo opens a turn at once. See Barge-in: in a room. Transcripts are not filtered: on a speakerphone your agent's voice appears as one of the spk_N voices. Turn and barge-in events still ignore it. A room silent for idle_timeout_s (default 600) gets a warning, then closes with 1000 idle_timeout; its final transcripts are sent first. See Barge-in.
Pass messages as on the streams: Baton uses the conversation so far to judge whether an utterance is complete. It is read once, at session.start. See End of turn.