231### Client Messages231### Client Messages
232 232
233* **Binary frames** — raw audio in the specified encoding (streamed in real-time-paced chunks, e.g. 100 ms)233* **Binary frames** — raw audio in the specified encoding (streamed in real-time-paced chunks, e.g. 100 ms)
234* **`{"type": "finalize"}`** — force the current utterance to finalize as `speech_final` immediately for PTT
234* **`{"type": "audio.done"}`** — signal end of audio, triggers `transcript.done`235* **`{"type": "audio.done"}`** — signal end of audio, triggers `transcript.done`
235 236
236`transcript.done` tells the server no more audio will be sent and to flush the remaining transcript and close the websocket.237`transcript.done` tells the server no more audio will be sent and to flush the remaining transcript and close the websocket.
237 238
239**Push-to-talk example** (finalize on button release, then continue the session):
240
241```json
242{"type": "Finalize"}
243```
244
245**Per-channel finalize** (multichannel only — e.g. agent on channel 0):
246
247```json
248{"type": "Finalize", "channel": 0}
249```
250
238### Multichannel Streaming251### Multichannel Streaming
239 252
240When `multichannel=true` and `channels` ≥ 2, the server transcribes each audio channel independently. Send interleaved multichannel PCM (e.g. L,R,L,R,… for stereo) as binary frames, and the server de-interleaves and processes each channel in parallel.253When `multichannel=true` and `channels` ≥ 2, the server transcribes each audio channel independently. Send interleaved multichannel PCM (e.g. L,R,L,R,… for stereo) as binary frames, and the server de-interleaves and processes each channel in parallel.
244* `transcript.created` is sent once (session-level — no `channel_index`).257* `transcript.created` is sent once (session-level — no `channel_index`).
245* `transcript.partial` events include a `channel_index` field (0-based) identifying the source channel. Events from different channels arrive interleaved.258* `transcript.partial` events include a `channel_index` field (0-based) identifying the source channel. Events from different channels arrive interleaved.
246* `transcript.done` is sent **once per channel** after `audio.done`, each with its own `channel_index`.259* `transcript.done` is sent **once per channel** after `audio.done`, each with its own `channel_index`.
260* Client `Finalize` without `channel` finalizes every channel at once; `{"type": "Finalize", "channel": N}` finalizes only channel `N` (0-based).
247* Chunk sizes should account for all channels — e.g. for stereo PCM16 at 16 kHz, 100 ms = 6,400 bytes (3,200 per channel × 2 channels).261* Chunk sizes should account for all channels — e.g. for stereo PCM16 at 16 kHz, 100 ms = 6,400 bytes (3,200 per channel × 2 channels).
248 262
249**Example URL:**263**Example URL:**