Skip to main content
(new in 4.6) Speaker diarization finds who spoke when in an audio file. When it is enabled, the response contains a speakers list that splits the transcript into speaker turns, each with an anonymous speaker label and its timestamps. Diarization runs as part of audio processing. It does not change which entities are detected or how the audio is redacted.

Parameters

Below are the parameters that control the behaviour of speaker diarization. These parameters shall be specified under audio_options.diarization. If you know the exact number of speakers, set min_speakers and max_speakers to the same value. This makes the results much more reliable, especially for short files (see Limitations). See the audio_options object in the API reference for the full list of audio parameters.
Diarization slows down audio processing. See Speaker Diarization benchmarks for the throughput with and without diarization.

Sample Request

Sample Response

Response
Each item in speakers is one speaker turn, in time order. stt_time and end_time are in seconds, from the start of the turn’s first word to the end of its last word. stt_idx and end_idx point to the turn’s text in processed_text, and are not returned when return_processed_text is False. See the API reference for the full response schema. Speaker labels are anonymous and only valid inside one file. SPEAKER_00 in one file is not the same person as SPEAKER_00 in another file. Diarization does not identify who a speaker is.

Limitations

Diarization is a statistical process and it makes mistakes. Treat speaker labels as a best guess, and review them when accuracy matters. In our testing we observed the following limitations:
  • One speaker at a time. Each moment of audio is assigned to exactly one speaker. When two or more people talk at the same time, only one of them is labeled, and the overlapping speech can end up in the wrong turn.
  • Most errors happen at speaker changes. Around 90% of the errors we observed are close to a point where the speaker changes. The words at the start or end of a turn are the ones most likely to be assigned to the wrong speaker.
  • Short replies are often mislabeled. Very short turns such as “yes”, “mhm”, or “okay” contain too little speech to recognize the voice, so they can easily be assigned to the wrong speaker.
  • Short files can get the wrong number of speakers. If a speaker has less than about 30 seconds of speech in the file, there may not be enough audio to tell their voice apart from the others. Two speakers can then be merged into one, or one speaker split into two. Setting min_speakers and max_speakers helps when you know how many people are speaking.
  • Group and in-person discussions are harder. Conversations with many participants, frequent interruptions, or people talking over each other have many speaker changes and a lot of overlapping speech.
  • Tested on English only. We have only tested diarization on English audio. It can be used with other supported languages, but its accuracy on them has not been measured.
  • At most 10 speakers. min_speakers and max_speakers accept values up to 10. In general, the more speakers a recording has, the lower the accuracy, because there are more voices to tell apart and usually more speaker changes.

Getting Better Results

  • Set min_speakers and max_speakers when you know the number of speakers.
  • Expect the best results on recordings where people take turns and do not talk over each other, such as interviews and calls.
  • Use the speaker labels for longer turns with more confidence than for short replies or the words around a speaker change.