This guide applies to: Direct WebSocket integrations that stream raw PCM audio to Ambient, Form filling, or Dictation. Form filling uses the same ambient socket (
GET /ws/stream) with an ambient session ID.For the exact WebSocket message formats, see WebSocket streaming wire format.What this guide covers
Use this guide before implementing audio capture or opening a WebSocket connection. You will learn:- The audio format required by Ambient, Form filling, and Dictation
- How to prepare and stream audio over the WebSocket
- Recommended network requirements for reliable real-time streaming
- Product-specific streaming differences you must handle
What audio format should you capture
Ambient, Form filling, and Dictation all use the same recommended audio format.16 kHz Sample Rate
Capture audio at 16 kHz to preserve the full range of clinical speech.
Mono Audio
Capture a single mono channel. Do not stream stereo or multi-channel audio.
LINEAR16 PCM
Encode audio as LINEAR16 (PCM signed 16-bit little-endian). Dictation refers to the same format as PCM_S16LE. Strip WAV headers before streaming.
100 ms Chunks
Stream audio in approximately 100 ms chunks. At 16 kHz mono 16-bit, each chunk is about 3200 bytes of raw PCM.
What should you avoid
Avoid the following common mistakes:- Sending binary WebSocket frames instead of JSON text frames
- Sending multiple JSON objects in a single WebSocket message
- Encoding audio with hexadecimal, URL-safe Base64, or other non-standard Base64 variants
- Streaming audio over HTTP using
Content-Type: application/json
How do you prepare audio for streaming
Once audio has been captured:- Split the PCM stream into approximately 100 ms chunks.
- Encode each chunk using standard Base64 (RFC 4648).
- Wrap each chunk in a single JSON message.
- Send one JSON text frame per audio chunk.
- Stream chunks at approximately real-time speed so transmission stays synchronized with the captured audio.
What network requirements are recommended
All streaming uses secure WebSockets (wss://).
For reliable real-time streaming, Suki recommends the following minimum network conditions:
For the source of these recommendations, see Audio capture and streaming FAQs.
For keep-alives, reconnection behavior, and pause handling, see Streaming architecture.
What differs by product
Although all products use the same audio format, each streaming API has different protocol requirements.Ambient and Form filling
- Send a
START_TIMEmessage before streaming audio. - Send Base64 PCM in the
datafield. - End the stream by sending a final
AUDIOmessage whosedatavalue isRU9G(Base64 of ASCIIEOF). - While the stream is active, send audio at least once every 25 seconds, or Suki disconnects the stream.
- While the stream is paused, send an
EVENTmessage withevent:KEEP_ALIVEat least every 5 seconds. An ambient session can remain paused for up to 30 minutes. - You can reconnect to
/ws/streamusing the sameambient_session_idonly while the session remains in theCREATEDstate. Otherwise the handshake returnsFailedPrecondition. - Sessions shorter than 1 minute may not contain enough audio for note generation and can be marked as
skipped.
Dictation
- Open
/ws/transcribeonly when the session state isREADYorIDLE. If the session is not ready, the handshake returnsFailedPrecondition. - Send Base64 PCM in
audioData, notdata. - End streaming by sending
{"type":"EVENT","event":"AUDIO_END"}after the lastAUDIOchunk. - Use interim transcripts (
is_final: false) for live display, and treatis_final: trueas the finalized transcript. See Dictation transcript frames.