Speaker diarization, explained from a working pipeline.

Updated ยท 3 min read

The short answer

Speaker diarization answers who spoke when. It splits a recording into turns and labels each one Speaker 1, Speaker 2 and so on, without knowing who anyone is.

Most systems find where speech is, turn short pieces into voice prints, and group the prints that sound alike. You can run it with pyannote.audio, NVIDIA NeMo or sherpa-onnx, or Fraze does it on your Mac or Windows PC with nothing uploaded.

On this page
  1. Speaker diarization vs speaker identification
  2. How a speaker diarization pipeline works
  3. How Fraze does it on your computer
  4. How to measure diarization
  5. Open source and cloud options
  6. Where diarization goes wrong
  7. Questions

Speaker diarization vs speaker identification

Question it answersNeeds known voices firstTypical use
Speaker diarizationWho spoke when?NoMeetings, interviews, podcasts, transcripts
Speaker identificationWhich known person is this?Yes, an enrolled sample of each personVoice login, personalized assistants
FrazeWho spoke when, in a saved transcriptNo. You name the speakers yourselfLabeled transcripts on your own computer

Diarization knows only that voices differ. The labels stay numbers until someone gives them names.

How a speaker diarization pipeline works

  • Voice activity detection marks where there is speech and drops silence, music and noise.
  • Segmentation cuts speech into pieces short enough to hold one voice each.
  • A speaker embedding model turns each piece into a voice print, a list of numbers that comes out close for the same voice.
  • Clustering groups prints that are alike. Each group becomes a speaker.

NVIDIA's NeMo documentation describes the classic pipeline in four parts.

How Fraze does it on your computer

A recorded meeting in Fraze's History with two named speakers, Anna and Ben, and a summary
The box marks a speaker name. Click a name to change it on every line.
  1. Voice printsOne for every two seconds of the session
  2. GroupsThe most alike prints join first
  3. SpeakersEach line gets the voice heard most in it
How Fraze labels speakers, all on the computer.
  • Fraze passes each two seconds of a session through 3D-Speaker's CAM++ model, about 28 MB, and keeps the 192 numbers it returns. It keeps no audio.
  • When you choose Label speakers in History, Fraze groups the prints by how alike they are and stops when no two groups are alike enough.
  • A voice heard for less than four seconds, or less than 1 percent of the speech, joins the closest real speaker.
  • Labeling a transcript twice gives the same speakers.

How to measure diarization

The pyannote.metrics documentation defines diarization error rate as false alarm plus missed detection plus confusion, divided by the total reference speech. Lower is better.

Scores depend on the audio. The pyannote.audio README gives its community-1 pipeline 11.2 percent on VoxConverse and 46.8 percent on the Ego4D development set. Compare systems on recordings like your own.

Open source and cloud options

Runs whereLicense or termsWorth knowing
pyannote.audioYour machine, PythonLibrary MIT. The community-1 pipeline is CC-BY-4.0, and you accept its conditions on Hugging FaceNeeds a Hugging Face token and ffmpeg. A GPU helps
NVIDIA NeMoYour machine, PythonApache 2.0Cascaded pipeline and the end-to-end Sortformer model
sherpa-onnxYour machine, from C, Python, JavaScript, Swift and moreApache 2.0Segmentation and embedding models, no Python needed
Cloud APIsThe provider's serversThe provider's pricing and termspyannoteAI, Gladia and Soniox, among others. The audio is uploaded
FrazeYour Mac or Windows PCPaid app, first 30 minutes freeFor people who want labeled transcripts, not code

The pyannote.audio README gives this example, after you accept the model's conditions on Hugging Face and create an access token.

from pyannote.audio import Pipeline

pipeline = Pipeline.from_pretrained(
    "pyannote/speaker-diarization-community-1", token="HUGGINGFACE_ACCESS_TOKEN"
)
output = pipeline("audio.wav")  # runs locally

for turn, speaker in output.speaker_diarization:
    print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}")

Where diarization goes wrong

  • Two people at once. A cascaded system gives each piece one speaker, so the louder voice wins.
  • Short turns. A quick yes carries too little voice for a reliable print.
  • Similar voices on the same microphone can end up as one speaker.
  • Fraze gives each line one speaker, so a quick interruption inside a line keeps the voice heard most.

Questions

What is speaker diarization in simple terms?

It works out who spoke when in a recording. It labels each turn Speaker 1, Speaker 2 and so on, without knowing anyone's name.

Is pyannote free?

The pyannote.audio library is MIT licensed, and its community-1 pipeline uses the CC-BY-4.0 license. You accept the pipeline's conditions on Hugging Face and use an access token to download it. pyannoteAI also sells a hosted pipeline.

What is a good diarization error rate?

It depends on the audio. The pyannote.audio README gives the same pipeline about 11 percent on one public dataset and about 47 percent on another. Test on recordings like yours.

Can speaker diarization run offline?

Yes. pyannote.audio, NeMo and sherpa-onnx all run on your own machine once the models are downloaded. Fraze labels speakers on your Mac or Windows PC with no internet needed after the first download.

Does Fraze label speakers in real time?

No. Fraze takes voice prints during the session and groups them afterwards, when it can compare the whole conversation. Labels work on sessions saved while Tell speakers apart is on in Settings, which is the default.

Try it on your next call.

Download Fraze

macOS 14 or later on Apple silicon, and Windows 11. No account needed.