Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions chapters/audio-intelligence/speaker-diarization.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: 'Speaker Diarization'
title: 'Speaker diarization for pre-recorded audio'

Check warning on line 2 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L2

Did you really mean 'diarization'?
sidebarTitle: Diarization

Check warning on line 3 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L3

Did you really mean 'Diarization'?
description: 'Detect speakers and understand who said what.'
description: 'Enable speaker diarization for pre-recorded audio in Gladia. Configure speaker-count hints and read speaker labels, timestamps and limitations.'

Check warning on line 4 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L4

Did you really mean 'diarization'?

Check warning on line 4 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L4

Did you really mean 'Gladia'?
---

import PrerecordedBadge from "/snippets/badges/prerecorded.mdx"

<PrerecordedBadge />


Speaker diarization is the process of detecting multiple speakers in an audio, and understanding which parts of the transcription each speaker said.
Speaker diarization assigns speaker labels to segments of pre-recorded audio so you can identify who spoke when. In Gladia, enable `diarization` on the pre-recorded transcription request. The response associates each utterance with a speaker index in order of first appearance. These labels distinguish speakers within the recording and do not establish a person's identity.

Check warning on line 12 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L12

Did you really mean 'diarization'?

Check warning on line 12 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L12

Did you really mean 'Gladia'?

## Enabling diarization

Check warning on line 14 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L14

Did you really mean 'diarization'?

Diarization is enabled by sending the `diarization` parameter in the transcription request:

Check warning on line 16 in chapters/audio-intelligence/speaker-diarization.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/audio-intelligence/speaker-diarization.mdx#L16

Did you really mean 'Diarization'?
```json Pre-recorded
{
"audio_url": "<your audio URL>",
Expand All @@ -38,7 +38,7 @@
"end": 2.364,
"confidence": 0.8914285714285715,
"channel": 0,
"speaker": 0,
"speaker": 0
},
...
]
Expand All @@ -49,12 +49,18 @@

## Improving diarization accuracy

You can improve the accuracy of the diarization by providing the model with hints regarding the expected number or lower/upper bounds ofspeakers using the `diarization_config.num_of_speakers`, `diarization_config.min_speakers` and `diarization_config.max_speakers` parameters respectively.

**Important:** These parameters are hints, not hard constraints. The actual number of speakers detected by the model may not comply with the provided parameters.
Provide speaker-count hints with `diarization_config.number_of_speakers`, `diarization_config.min_speakers` and `diarization_config.max_speakers`. These specify the expected count, lower hint and upper hint respectively. They are hints, not hard constraints; the detected count may differ.

| Key | Type | Description |
| --- | --- | --- |
| `diarization_config.number_of_speakers` | number | Guiding number of speakers - instructs the model to detect an exact number of speakers in the audio. |
| `diarization_config.min_speakers` | number | Instructs the model to detect no less than this number of speakers in the audio. |
| `diarization_config.max_speakers` | number | Causes the model to detect no more than this number of speakers in the audio. |
| `diarization_config.number_of_speakers` | number | Expected speaker-count hint. It does not guarantee that the detected count matches this value. |
| `diarization_config.min_speakers` | number | Lower speaker-count hint, not an enforced minimum. |
| `diarization_config.max_speakers` | number | Upper speaker-count hint, not an enforced maximum. |

## Diarization scope and evaluation

This guide covers speaker diarization for **pre-recorded audio** only.

Speaker diarization labels who spoke when within a single mixed audio track, while transcription accuracy measures word errors in the transcribed text. Channel identification instead relies on separate audio channels, reported in each utterance's `channel` field, rather than telling speakers apart within one track (see [Multiple channels](/chapters/limits-and-specifications/multiple-channels)). For concept definitions, see [speaker diarization concepts](https://www.gladia.io/blog/what-is-diarization).

Async accuracy comparisons use the model and dataset scope described in the [async benchmark methodology](https://www.gladia.io/competitors/benchmarks). Use the [blind API comparison](https://www.gladia.io/compare-stt-apis) tool and check [pricing](https://www.gladia.io/pricing) for current plans. Speaker-count hints do not guarantee a specific detected speaker count.
Loading