Speaker diarization

Label interview speakers

Reviewed

For an interview recorded on one mixed track, request speaker diarization. It assigns numbers to the voices so you can find each change of speaker. Listen back before replacing a number with a name. If each microphone was recorded on its own channel, keep those channels separate and confirm who used each microphone.

Request speaker turns from Deepgram

Set AUDIO to the path of an English WAV recording and DEEPGRAM_API_KEY to your key. This prerecorded request selects Nova-3, pins the batch diarizer to v2 and asks for punctuated utterances. Set TRANSCRIPT_JSON to a new output path so you can inspect both the turns and the individual words. Deepgram speaker diarization documentation · Prerecorded API reference

curl --fail-with-body --silent --show-error \
  'https://api.deepgram.com/v1/listen?model=nova-3&language=en&diarize_model=v2&utterances=true&punctuate=true' \
  -H "Authorization: Token $DEEPGRAM_API_KEY" \
  -H 'Content-Type: audio/wav' \
  --data-binary "@$AUDIO" -o "$TRANSCRIPT_JSON"

jq -er '.results.utterances[] |
  [.start, .end, .speaker, .transcript] | @tsv' "$TRANSCRIPT_JSON"

The four columns are the start time, end time, speaker number and words spoken. An utterance can end at a pause, so adjacent rows may belong to the same speaker. A turn may also need several readable subtitle cues. Keep the approved speaker label on each cue where a viewer needs it. Deepgram utterance fields

Review the change of voice

  • Play a clear passage from each person and write down the mapping for this recording. If you transcribe chunks independently, verify that mapping again at the join. The number alone does not establish identity across requests.
  • Listen around interruptions, overlapping speech and short replies such as “right.” Check the speaker assigned to the first word after the interruption. In prerecorded results, speaker_confidence describes the speaker assignment and confidence describes word recognition. Deepgram’s annotated response
  • When you cannot verify who spoke, leave the label neutral. For interviews with isolated left and right channels, Deepgram’s multichannel=true returns a separate result for each channel. This preserves the microphone assignment when both people talk at once. Deepgram multichannel documentation

Keep the attribution visible in the subtitle

In SRT, a visible prefix such as [Interviewer] travels with the text. WebVTT can also attach a voice annotation with <v Interviewer>. A player may use that annotation for styling without displaying the name. Include the name in the visible words when viewers need it. WebVTT voice span specification

Using OpenRouter instead? Its transcription endpoint documents a top-level diarize option for supported models together with response_format=verbose_json. Look for a numeric speaker on the returned words. The available fields depend on the model and provider. OpenRouter speaker and timestamp documentation

Local check. We ran the jq expression on a hand-written utterance and confirmed that it preserves speaker number zero. The Deepgram request follows its prerecorded API documentation. Label accuracy requires listening to the recording.

Related reading

Export SRT and WebVTTHighlight the current wordCompare transcription routesThe studio check