Implementation:Elevenlabs Elevenlabs python SpeakerSeparationResponseModel
| Metadata | Value |
|---|---|
| source | Elevenlabs_Elevenlabs_python |
| domain | Voices, Speaker Diarization |
| last_updated | 2026-02-15 |
Overview
Description: SpeakerSeparationResponseModel is a Pydantic model that represents the result of a speaker separation (diarization) operation in ElevenLabs. It links to the voice and sample being processed, provides the current status of the separation operation, and includes the identified speakers along with their selection state. This model enables isolating individual speakers from multi-speaker audio samples.
Usage: This model is returned by the ElevenLabs API when performing speaker separation on voice samples. It allows developers to track the progress of speaker diarization, inspect the identified speakers, and determine which speakers have been selected for use in voice cloning or other voice-related operations.
Code Reference
Source file: src/elevenlabs/types/speaker_separation_response_model.py
Class signature:
class SpeakerSeparationResponseModel(UncheckedBaseModel):
...
Import statement:
from elevenlabs.types import SpeakerSeparationResponseModel
I/O Contract
| Field | Type | Required | Description |
|---|---|---|---|
| voice_id | str | Yes | The ID of the voice |
| sample_id | str | Yes | The ID of the sample |
| status | SpeakerSeparationResponseModelStatus | Yes | The status of the speaker separation operation |
| speakers | Optional[Dict[str, Optional[SpeakerResponseModel]]] | No | The speakers identified in the sample, keyed by speaker ID |
| selected_speaker_ids | Optional[List[str]] | No | The IDs of the selected speakers |
Usage Examples
from elevenlabs.types import SpeakerSeparationResponseModel
# Working with a speaker separation response from the API
separation = SpeakerSeparationResponseModel(
voice_id="voice_abc123",
sample_id="sample_xyz789",
status="completed",
speakers={
"speaker_1": None,
"speaker_2": None,
},
selected_speaker_ids=["speaker_1"],
)
# Check separation status
print(f"Voice: {separation.voice_id}")
print(f"Sample: {separation.sample_id}")
print(f"Status: {separation.status}")
# List identified speakers
if separation.speakers:
for speaker_id, speaker_data in separation.speakers.items():
selected = speaker_id in (separation.selected_speaker_ids or [])
print(f"Speaker {speaker_id}: {'selected' if selected else 'not selected'}")