Diarization
Diarize recognizes speaker changes and assigns a speaker to each word in the transcript.
diarize
boolean Default: false
Try this feature out in our API Playground!
Enable Feature
To enable Diarization, use the following parameter in the query string when you call Deepgram’s /listen
endpoint :
diarize=true
To transcribe audio from a file on your computer, run the following cURL command in a terminal or your favorite API client.
Replace YOUR_DEEPGRAM_API_KEY
with your Deepgram API Key.
Analyze Response
For this example, we use an MP3 audio file that contains the beginning of a customer call with Premier Phone Services. If you would like to follow along, you can download it.
When the file is finished processing, you’ll receive a JSON response. Let’s look more closely at the words
object within the alternatives
object within this response.
Pre-Recorded
When using diarization for pre-recorded audio, both speaker
and speaker_confidence
values will be returned:
Live Streaming
When using diarization for live streaming audio, only the speaker
value will be returned:
Use the API reference or the API Playground to view the detailed response.
Format Response
To improve readability, you can use a JSON processor to parse the JSON. In this example, we use JQ and further improve readability by turning on Deepgram’s punctuation and utterances features:
Replace YOUR_DEEPGRAM_API_KEY
with your Deepgram API Key.
When the file is finished processing, you’ll receive the following response:
To learn more about when to use Deepgram’s Diarization or Multichannel feature, see When to Use the Multichannel and Diarization Features.
What’s Next