- Create a Dictation session before streaming
- Complete the session after streaming
- Retrieve the final or cumulative transcription results
How Dictation streaming works
Suki for Partners Dictation streaming works as follows:- Create or reuse a Dictation session.
- Open a WebSocket connection to
GET /ws/transcribe. - Send one JSON message per audio chunk.
- Send an explicit end-of-audio message when the user stops speaking.
- Read partial and final transcript messages from the socket.
- Close the socket, then use End Dictation session to end the Dictation session and retrieve results.
GET /ws/transcribe only when the Dictation session is READY or IDLE.
If the session is RUNNING because another audio stream is active, COMPLETED, or in another state that cannot accept speech, the WebSocket handshake fails. The server returns FailedPrecondition with a message such as transcript session is not accepting new speech sessions.
One Dictation session can support multiple speech sessions over time, such as push-to-talk. After you send
AUDIO_END and the server finishes processing that stream, wait until the session returns to READY or IDLE before opening another WebSocket for the next utterance.Send JSON text frames
Every message you send on/ws/transcribe must be a UTF-8 JSON text frame.
- Each WebSocket frame must contain exactly one JSON object.
- Each client
sendshould contain one logical message. - Audio bytes go inside a JSON string field, not in a binary WebSocket frame.
Audio streaming recommendations
Sample Rate of 16 kHz
Stream Dictation audio at 16 kHz, which matches the capture rate used in the Dictation streaming examples.
Mono Channel
Send a single mono channel of audio, not stereo or multi-channel.
PCM_S16LE Encoding
Encode as PCM_S16LE (PCM signed 16-bit little-endian). Remove WAV headers or decode to raw PCM before you send.
About 100 ms per Chunk
For 16 kHz, mono, 16-bit audio, about 3200 bytes per chunk is about 100 ms of audio. Size chunks to your capture pipeline if your encoder differs.
Stream at Real-Time Speed
Pace audio chunks to match their actual duration and stream at or near real time, rather than sending buffered audio as fast as possible.
References
Wire Format
Message types, send order, example flow, and how to format and chunk audio.
Audio Capture Best Practices
Capture format, environment, gain, and network readiness before you stream.
Dictation Transcript Frames
Partial and final transcript messages, interim vs final commit, and insertion spacing.
Complete the Session
Close the socket, end the session, fetch results, and use the streaming error reference.
Dictation Streaming API
Endpoint details, handshake steps, and code samples for the Dictation WebSocket.