Speaker diarization: how it works and how to evaluate it

Two speakers sharing a microphone, with distinct waveform cues
Two speakers sharing a microphone, with distinct waveform cues

Speaker diarization labels an audio recording by speaker, answering “who spoke when?” It makes conversations easier to transcribe, search, summarize, and analyze. For developers building meetings, media, or voice-agent products, the harder questions are when labels are necessary, how they behave during overlapping speech, and whether downstream decisions can trust them. Those decisions start with the audio source and end with a defined evaluation.

What speaker diarization does

Speaker diarization groups speech from the same voice under a consistent label, such as Speaker 1 or Speaker 2, and locates that speech on a timeline. It can work without knowing the speakers' names in advance. A speaker who leaves and returns should retain the same label within the recording.

Automatic speech recognition (ASR) estimates the words. Diarization estimates which speaker produced each span. Combining them creates a speaker-attributed transcript. The two tasks can be modeled separately or jointly, as described in a diarization research review.

Consider this simplified conversation:

Audio intervalSpeaker labelTranscript
0–4 secondsSpeaker 1“Can we move the appointment?”
3–5 secondsSpeaker 2“Yes, which day?”
5–8 secondsSpeaker 1“Thursday afternoon.”

Both speakers are active from seconds 3 to 4. A diarization output that permits only one label at a time cannot fully represent that overlap.

The labels establish neither identity nor role. Speaker 1 could be a customer, an interviewer, or a person in the background. Mapping a label to “caller” or “agent” requires additional evidence. Authenticating a person requires a separate mechanism.

Diarization versus segmentation, recognition, and channel labels

TaskQuestion answeredTypical output
Voice activity detection (VAD)Is speech present?Speech and non-speech regions
Speaker segmentationWhere does the speaker change?Boundaries between speaker-homogeneous regions
Speaker diarizationWhich regions belong to the same speaker?Consistent anonymous labels and timestamps
ASRWhat was said?Words, sometimes with timestamps
Speaker identification or verificationWhich known voice is this, or does it match an enrolled voice?A match against a known voice profile
Channel attributionWhich audio channel supplied this result?A source-channel tag

Segmentation alone does not connect a returning speaker's later words to their earlier turn. Our voice activity detection guide explains the speech-presence decision that often precedes these steps.

Diarization also differs from speech separation, which estimates separate audio signals for overlapping voices. Speaker labels describe activity; they do not automatically provide an isolated recording of each person.

How speaker diarization works

A common modular pipeline has four stages:

  1. Locate speech. Speech detection finds regions to process. Missing a quiet utterance here can remove it from later attribution.
  2. Represent voice characteristics. A speaker embedding is a vector, a numerical representation of voice characteristics extracted from an audio window.
  3. Group related windows. Clustering assigns similar representations to speaker groups. The system may estimate the number of speakers or use a supplied count or range.
  4. Refine activity and boundaries. Later processing adjusts the timeline, including speaker changes and overlapping activity where supported.

End-to-end neural diarizers instead predict speaker activity directly, reducing the separation between these stages. Their output can represent multiple active speakers per frame when the model supports it. Architecture, training, and output constraints all affect behavior; the term “end-to-end” alone establishes no accuracy advantage.

A transcript integration has another job: align recognized words with the speaker timeline. A word that straddles a boundary or occurs during overlap needs an assignment policy. Clean sentence formatting can hide uncertainty at that boundary.

When do you need diarization?

Diarization is useful for meeting transcripts, interviews, podcast indexing, and mixed call recordings. Speaker-specific summaries and talk-time measurements depend on attribution being correct.

For voice agents, start with the media topology: how participant audio reaches the application. Separate known participant tracks already carry useful source information. Mixing them and then inferring the original speakers discards evidence the application had.

Audio sourceAppropriate attribution approachRemaining limit
Separate tracks, each bound to one participantPreserve track and participant metadataA participant connection is not proof of a person's identity
One mixed recording of several speakersInfer speaker labels with diarizationLabels still need role mapping
A speakerphone track containing several peoplePreserve the track and diarize within itOne track can contain several speakers
A transfer or conference that changes participantsPreserve participant-change events and update attributionA channel or role may outlive the person using it

Google Cloud, for example, returns channel tags for multi-channel recognition and numbered speaker labels for diarization. The design implication is to keep source-channel metadata and inferred speaker labels as separate fields. They answer different questions.

A stereo file is not necessarily a separated two-party recording. Its channels might contain the same mixed audio. Likewise, “Speaker 1” does not universally mean the first person to speak; label ordering depends on the system.

For a two-party agent conversation with reliable separate tracks, diarization may add little. It becomes useful when several voices share a source or source separation is unavailable.

Batch versus real-time speaker diarization

Batch diarization processes a supplied recording and can use later audio to resolve earlier assignments. Streaming diarization works with audio as it arrives, so useful labels must emerge from less context.

A fast batch processor is not automatically a real-time system. It may still require the full file. Streaming needs a continuing output contract, bounded processing delay, and a way to handle speakers as new evidence arrives.

Streaming Sortformer research illustrates one design: a cache retains representations of previously observed speakers, with output speakers ordered by arrival time. This is a particular model design, not a universal rule for diarization APIs.

Keep provisional attribution revisable

Streaming applications need to distinguish:

  • Text finality: whether a recognized span's words can change.
  • Speaker finality: whether its speaker assignment can change.
  • Role binding: whether the application has enough evidence to associate that speaker with a participant role.

One flag should not stand in for all three. A final transcript can contain an incorrect speaker label. A stable speaker label can remain anonymous.

Provider behavior also matters. Google Cloud's streaming recognition results distinguish interim output from final output for a particular audio portion. Its diarization output aggregates prior words across results. An integration that appends each cumulative response would duplicate speech.

The practical design is to replace the relevant provisional span, retain the source timing, and reconcile speaker updates according to the service's contract. Our real-time transcription guide covers the broader transcript-event lifecycle.

Keep live response control separate from post-call attribution. Detecting a caller interruption and stopping agent playback require a runtime control path. A diarized transcript produced later cannot perform that job retroactively.

Why speaker attribution fails

Overlap is only one failure mode. Short acknowledgments such as “yes” provide little voice evidence. Background voices can introduce extra clusters. A new speaker after a transfer may be merged into an existing label. One speaker's changing microphone or acoustic conditions can also split their speech across labels.

Failures propagate differently:

Observed problemDownstream consequenceEvidence that helps isolate it
Speech is missing entirelyAn incomplete transcript or summaryOriginal audio and speech-detection output
Correct words have the wrong speakerIncorrect talk time or speaker-specific summaryWord timing and reference speaker activity
A returning voice receives a new labelOne person's contribution is fragmentedFull-session speaker timeline
Speaker labels are consistent but roles are reversedCaller words are scored as agent behaviorParticipant metadata and role-binding history
A provisional assignment changes after useLive decisions differ from the final recordThe attribution version consumed by the decision

The fourth case is easy to miss. Diarization labels are arbitrary identifiers. A scorer can correctly match the system's Speaker 1 to reference speaker B and Speaker 2 to reference speaker A. Swapping the label numbers alone is not an error. An application that hard-codes Speaker 1 as “agent” can still reverse the roles.

That means a good diarization score does not prove correct role attribution. Preserve the label, its source track, the evidence behind its role, and any later correction separately.

How to evaluate speaker diarization

A useful evaluation separates speaker activity, recognized words, streaming behavior, and the application's interpretation of the labels.

Define DER and JER precisely

Diarization error rate (DER) combines three time-based errors after mapping system labels to reference speakers:

  • Missed speech: reference speech the system did not detect.
  • False alarm: predicted speech without corresponding reference speech.
  • Speaker confusion: detected speech assigned to the wrong speaker.

DER = (missed speech + false alarm + speaker confusion) / reference speaker time

The DER scoring definition uses reference speaker time, not the recording's wall-clock duration. When overlap is scored, simultaneous speakers contribute separate speaker time.

Jaccard error rate (JER) first matches reference and predicted speakers one-to-one, then averages speaker-specific errors based on the intersection and union of their activity. It weights reference speakers equally, while pooled DER is duration-weighted. A brief participant therefore has different influence on the two measures. The pyannote.metrics reference defines both metrics and their scoring controls.

For a toy example with no overlap, assume 100 seconds of reference speech, 10 seconds missed, 5 seconds of false alarm, and 5 seconds of confusion. DER is (10 + 5 + 5) / 100 = 20%. This is scoring arithmetic, not a model benchmark.

Word error rate (WER) measures transcription errors. It does not assess speaker labels. All words can be correct while the wrong participant receives every sentence.

Make the scoring policy part of the result

A DER number needs its evaluation conditions:

  • Dataset and reference annotations.
  • Scorer and version, including label-matching behavior.
  • Scored regions and speaker-count assumptions.
  • Boundary collar, the interval excluded around reference boundaries.
  • Whether overlapping speech is included.
  • Whether speech detection is supplied as reference information or evaluated as part of the pipeline.

Excluding overlap removes a difficult part of conversational audio. A boundary collar can also exclude errors around short turns. Scores produced under different policies are not directly comparable.

For a concrete protocol, the DISPLACE-2024 evaluation plan scores overlap without a boundary collar and evaluates ASR separately using WER. Its multilingual far-field recordings are a distinct workload from a telephone voice agent.

Build a scorecard around the product's failure cost

  1. Use representative audio. Include mixed and separated channels, expected languages and accents, background noise, long sessions, and participant changes. Keep an evaluation set separate from tuning examples.
  2. Annotate the difficult moments. Reference labels need overlap, short backchannels, and transfer arrivals. Ambiguous audio needs an explicit annotation policy.
  3. Score the complete path. Report DER and JER under fixed settings, WER separately, and role-binding errors separately from anonymous clustering errors.
  4. Measure streaming at natural arrival speed. Capture delay from the relevant audio span to its first usable label, revisions before finality, and behavior under load. File-processing throughput answers a different question.
  5. Measure consequential errors. Count wrong-speaker summaries, misattributed agent statements, and actions based on unresolved roles. Aggregate duration-based scores can underweight a brief, important “yes” or “no.”

A low overall DER can coexist with poor performance on transfers or overlap. Results grouped by those conditions expose problems that an average hides. Acceptance thresholds belong to the application: searchable podcast navigation and a speaker-scoped agent action have different consequences.

Choosing a diarization implementation

A hosted transcription API with diarization reduces model-serving work and can return words and labels together. The integration still owns result reconciliation, role mapping, retention, and failure handling.

A self-operated pipeline gives the team control over inference and model configuration. Open-source projects such as pyannote.audio and NVIDIA NeMo provide diarization building blocks or pipelines. The team takes responsibility for compute, dependencies, capacity, upgrades, and alignment with its transcription system.

For live applications, a streaming-capable implementation needs explicit behavior for new speakers, overlap, label revisions, speaker-count limits, and session duration. Batch quality alone does not establish that behavior. The appropriate choice follows from those output requirements and the operating work the team can own.

Frequently asked questions

Does Whisper include speaker diarization?

The original open-source Whisper model performs speech recognition and related tasks; it does not itself return speaker diarization labels. A Whisper-based pipeline can add a separate diarizer and align its speaker intervals with the transcript. A transcription segment boundary is not evidence of a speaker change.

Does Speaker 1 identify the same person across calls?

An anonymous label alone provides no cross-call identity guarantee. Treat it as scoped to the recording or session unless an explicit system contract provides something more. Linking voices across calls is a separate speaker-recognition problem, and a label is never authorization to act for that person.

Put attribution into the voice-agent workflow

For a production voice agent, speaker attribution belongs alongside recordings, transcript revisions, participant changes, and the actions taken during the conversation. When attribution is uncertain, the application needs a clarification or review path rather than silently turning a voice cluster into a trusted role.

At Dasha, we help technical teams build and run production voice AI agents through a managed runtime, REST APIs, and a web application. Our Call Inspector brings completed-call transcripts, timeline events, model interactions, tool executions, and latency breakdowns together. Recordings are available when recording is enabled. That supports investigating what happened in a conversation; it is a different need from a standalone diarization model.

A meeting-transcription product may only need speech processing. A conversational product also needs the runtime and operational evidence around it. For that broader workflow, start building with Dasha.

Share

Subscribe

Sign up to our e-mail list to get the best of the Dasha blog sent directly to your inbox.

We use cookies for functional and analytical purposes. Please refer to our Privacy Policy for details.