How to Use AssemblyAI Speaker Diarization
Learn how to submit audio to AssemblyAI for speaker diarization, interpret speaker labels, check output quality, and fix common issues.
Before you start
AssemblyAI speaker diarization is a cloud service, not a local tool on your camera or microphone. You upload or stream an audio or video file to the service and receive a transcript with speaker labels. Prepare a recording that contains clear speech from the people you want to separate. Audio from a webcam, USB microphone, phone recorder, or meeting export can work, but the input level should be high enough for voices to remain distinct from background noise. Check the file format and sample rate accepted by the AssemblyAI API before submitting. No local installation is required for the transcription itself, although you need a way to send an API request from your computer or application.
Step-by-step instructions
The exact steps depend on whether you use the AssemblyAI web playground, a no-code automation tool, or code such as Python, JavaScript, or a command-line request. The speaker diarization setting is normally enabled through the speaker_labels option. The ordered workflow below covers a typical API request.
- 1. Obtain an AssemblyAI API key from your account.
- 2. Make sure the recording is accessible to the service. For a local file, upload it first and use the returned upload URL in the transcript request.
- 3. Create a transcript request and set speaker_labels to true.
- 4. If you are using the asynchronous API, include a webhook URL when you need automatic notification, or poll the transcript endpoint until the status is completed.
- 5. Retrieve the completed transcript and inspect the utterances array, where each utterance normally includes a speaker field such as A, B, or C.
Keep the request reversible while you test. Do not overwrite your original recording, and save the transcript ID from the response so you can retrieve the result again. If you are testing different settings, submit a fresh request rather than editing the only copy of an output file. Version differences can affect the exact option names or response fields, so consult the API reference for the platform or SDK version you are using.
Check the output
After the status becomes completed, confirm that the transcript contains text and that utterances include speaker labels. Open the request with the same transcript ID and look for a speaker value alongside each spoken segment. A useful check is to play the recording while reading the labeled segments and verify that each label stays with the same voice. Diarization estimates who speaks when; it does not identify people by name, so labels may be assigned as A, B, C and cannot be treated as verified identities. Accuracy can decrease when speakers talk over each other, when voices sound similar, or when the recording has heavy background noise or a low input level.
Common problems and next steps
If every speaker is labeled as one person, first check that speaker_labels is set to true. Also consider the recording conditions: distant or quiet voices from an input device, strong room echo, and constant background noise can make separation difficult. If the same speaker is split into multiple labels, try a cleaner recording with more consistent microphone placement and less crosstalk. If the service returns only an error or no transcript, verify the file format, upload URL, sample rate, and API key. Diarization requires voice activity, so a silent or music-only file will not produce useful speaker segments. After a successful run, keep the labeled transcript separate from the source file and avoid sharing it if the recording contains personal or private speech.