> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream Dictation Audio Overview

> Overview: Stream Dictation audio over WebSocket on GET /ws/transcribe for real-time transcript text

This guide explains how to stream live audio to <Badge color="blue" size="sm">GET /ws/transcribe</Badge> after creating a Dictation session.
The WebSocket is responsible only for streaming audio and receiving real-time transcript frames. Use the Dictation REST APIs to:

* Create a Dictation session before streaming
* Complete the session after streaming
* Retrieve the final or cumulative transcription results

For related guides:

<Accordion title="Click Each Button to Learn More" defaultOpen={true}>
  <div className="doc-guide-btn-row">
    <a href="/api-reference/audio-transcription/stream-transcription" className="doc-guide-btn">
      Dictation Streaming API
    </a>

    <a href="/documentation/concepts/dictation/dictation" className="doc-guide-btn">
      Audio Dictation Guide
    </a>

    <a href="/documentation/how-to/audio-streaming/streaming-architecture" className="doc-guide-btn">
      Architecture Diagram
    </a>
  </div>
</Accordion>

## How Dictation streaming works

Suki for Partners Dictation streaming works as follows:

1. Create or reuse a [Dictation session](/api-reference/audio-transcription/create-session).
2. Open a WebSocket connection to **`GET /ws/transcribe`**.
3. Send one JSON message per audio chunk.
4. Send an explicit end-of-audio message when the user stops speaking.
5. Read partial and final transcript messages from the socket.
6. Close the socket, then use [End Dictation session](/api-reference/audio-transcription/end-session) to end the Dictation session and retrieve results.

<Warning>
  Dictation streaming uses JSON text frames. Do not send raw binary audio frames to this endpoint.
</Warning>

**Before you connect** - Open **`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**.

<Note>
  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.
</Note>

## 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 **`send`** should contain **one logical message**.
* Audio bytes go inside a JSON string field, not in a binary WebSocket frame.

<Warning>
  Do not:

  * Send binary WebSocket frames for audio data on this JSON-based protocol.
  * Send more than one JSON object in a single frame.
  * Use HTTP endpoints to stream raw audio.

  <Note>
    If the server receives a non-JSON payload where JSON is expected, parsing can fail with errors such as invalid character or null byte errors.
  </Note>
</Warning>

## Audio streaming recommendations

<CardGroup cols={2}>
  <Card title="Sample Rate of 16 kHz" icon="waveform">
    Stream Dictation audio at **16 kHz**, which matches the capture rate used in the Dictation streaming examples.
  </Card>

  <Card title="Mono Channel" icon="microphone">
    Send a **single mono channel** of audio, not stereo or multi-channel.
  </Card>

  <Card title="PCM_S16LE Encoding" icon="file-audio">
    Encode as **PCM\_S16LE** (PCM signed 16-bit little-endian). Remove WAV headers or decode to raw PCM before you send.
  </Card>

  <Card title="About 100 ms per Chunk" icon="clock">
    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.
  </Card>
</CardGroup>

<Card title="Stream at Real-Time Speed" icon="gauge">
  Pace audio chunks to match their actual duration and stream at or near real time, rather than sending buffered audio as fast as possible.
</Card>

For encoding steps and message order, see [WebSocket streaming wire format](/documentation/how-to/audio-streaming/websocket-streaming-wire-format#audio-format-and-chunking). For capture guidance before you open the socket, see [Audio capture best practices](/documentation/how-to/audio-streaming/audio-capture-best-practices).

## References

<CardGroup cols={2}>
  <Card title="Wire Format" icon="code" href="/documentation/how-to/audio-streaming/websocket-streaming-wire-format" arrow={true}>
    Message types, send order, example flow, and how to format and chunk audio.
  </Card>

  <Card title="Audio Capture Best Practices" icon="microphone" href="/documentation/how-to/audio-streaming/audio-capture-best-practices" arrow={true}>
    Capture format, environment, gain, and network readiness before you stream.
  </Card>

  <Card title="Dictation Transcript Frames" icon="message" href="/documentation/how-to/audio-streaming/dictation-streaming-transcripts" arrow={true}>
    Partial and final transcript messages, interim vs final commit, and insertion spacing.
  </Card>

  <Card title="Complete the Session" icon="circle-check" href="/documentation/how-to/audio-streaming/websocket-streaming-complete-session" arrow={true}>
    Close the socket, end the session, fetch results, and use the streaming error reference.
  </Card>

  <Card title="Dictation Streaming API" icon="book" href="/api-reference/audio-transcription/stream-transcription" arrow={true}>
    Endpoint details, handshake steps, and code samples for the Dictation WebSocket.
  </Card>
</CardGroup>

## Available tutorials

<div className="hp-io-method-grid tut-hub-card-grid">
  <a className="hp-io-method-card tut-hub-method-card" href="/documentation/tutorials/dictation-websocket-code-example">
    <div className="tut-hub-card-media tut-hub-card-media--blue" aria-hidden="true" />

    <div className="hp-io-method-card-body">
      <span className="hp-wn-badge hp-wn-badge-new">Dictation</span>
      <h3 className="hp-io-method-card-title">Build a Dictation Streaming Client</h3>

      <p className="hp-io-method-card-desc">
        Create a transcription session, stream audio, read partial frames, and print the final transcript.
      </p>

      <div className="hp-io-method-card-meta tut-hub-card-foot" aria-label="15 min, Intermediate">
        <div className="tut-hub-card-foot-meta">
          <span className="hp-io-method-card-meta-time">15 min</span>
          <span className="tut-hub-level">Intermediate</span>
        </div>
      </div>
    </div>
  </a>
</div>

## Next steps

Continue in this order:

<Icon icon="file-lines" iconType="solid" /> Open the Dictation tab in [WebSocket streaming wire format](/documentation/how-to/audio-streaming/websocket-streaming-wire-format) for message types, send order, and audio chunking.

<Icon icon="file-lines" iconType="solid" /> Read [Dictation transcript frames](/documentation/how-to/audio-streaming/dictation-streaming-transcripts) to handle partial and final transcript messages in your UI.

<Icon icon="file-lines" iconType="solid" /> Follow [Complete the session after streaming](/documentation/how-to/audio-streaming/websocket-streaming-complete-session) to close the socket, end the session, and fetch results.
