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

# Speaker Diarization

> Label each transcribed word with the speaker who said it.

Speaker diarization identifies who said what in multi-speaker audio — calls, meetings, interviews — by labeling each transcribed word with a speaker identifier.

## Enabling diarization

Diarization is available on the [WebSocket streaming endpoint](/api-reference/sttAPI/speechtotext/transcribe-stream-websocket). Set both fields in `transcribeConfig`:

```json theme={"system"}
{
  "transcribeConfig": {
    "modelId": "assemblyai/u3-rt-pro",
    "audioEncoding": "LINEAR16",
    "sampleRateHertz": 16000,
    "enableSpeakerDiarization": true,
    "includeWordTimestamps": true
  }
}
```

<Note>
  Set `includeWordTimestamps` together with `enableSpeakerDiarization` — speaker labels are attached to word timestamps, not to the turn-level transcript.
</Note>

## Reading speaker labels

Each word in `wordTimestamps` carries a speaker identifier:

```json theme={"system"}
{
  "result": {
    "transcription": {
      "transcript": "Hi, I'm calling about my account balance.",
      "isFinal": true,
      "wordTimestamps": [
        { "word": "Hi,", "startTimeMs": 97, "endTimeMs": 194, "confidence": 0.99, "speaker": 0 },
        { "word": "I'm", "startTimeMs": 698, "endTimeMs": 779, "confidence": 0.99, "speaker": 0 }
      ]
    }
  }
}
```

Speaker identifiers are integers assigned within a stream in order of first appearance. They mark "same speaker in this session" — they do not identify a person across sessions.

<Note>
  Numbering varies by provider: AssemblyAI starts at 0, Soniox at 1.
</Note>

To build per-speaker segments, group consecutive words that share a `speaker` value. Words may occasionally arrive without a label; treat those as unattributed rather than assuming a speaker.

## Model support

| **Model**                                     | **Speaker diarization**         |
| :-------------------------------------------- | :------------------------------ |
| `assemblyai/u3-rt-pro`                        | <Icon icon="check" size={18} /> |
| `assemblyai/universal-streaming-english`      | <Icon icon="check" size={18} /> |
| `assemblyai/universal-streaming-multilingual` | <Icon icon="check" size={18} /> |
| `soniox/stt-rt-v4`                            | <Icon icon="check" size={18} /> |
| `soniox/stt-rt-v5`                            | <Icon icon="check" size={18} /> |
| `deepgram/flux-general-en`                    | <Icon icon="check" size={18} /> |
| `deepgram/flux-general-multi`                 | <Icon icon="check" size={18} /> |
| `inworld/inworld-stt-1`                       | Coming soon                     |
| `assemblyai/whisper-rt`                       | <Icon icon="xmark" size={18} /> |
| `groq/whisper-large-v3`                       | <Icon icon="xmark" size={18} /> |

## Next steps

<CardGroup cols={2}>
  <Card title="WebSocket API Reference" icon="code" href="/api-reference/sttAPI/speechtotext/transcribe-stream-websocket">
    Full message and configuration schema for the streaming endpoint.
  </Card>

  <Card title="Turn Detection" icon="arrows-turn-right" href="/stt/turn-detection">
    Detect when a speaker has finished talking.
  </Card>
</CardGroup>
