numerous-whale-53652
05/12/2025, 2:44 PMtall-airline-16756
05/12/2025, 2:44 PMtall-airline-16756
05/12/2025, 2:44 PMvoice_id
parameter: tts = elevenlabs.TTS(
voice_id="ODq5zmih8GrVes37Dizd",
model="eleven_multilingual_v2"
)
2. Using the voice
parameter with a Voice object: eleven_tts = elevenlabs.tts.TTS(
model="eleven_turbo_v2_5",
voice=elevenlabs.tts.Voice(
id="EXAVITQu4vr4xnSDxMaL",
name="Bella",
category="premade",
settings=elevenlabs.tts.VoiceSettings(
stability=0.71,
similarity_boost=0.5,
style=0.0,
use_speaker_boost=True
),
),
language="en"
)
You can also retrieve a list of available voices using await tts_11labs.list_voices()
to help you select the appropriate voice for each agent.
Sources: ElevenLabs integration guide | LiveKit Docs | Tree View: | dse-workbench | ElevenLabs TTS integration guide | LiveKit Docsnumerous-whale-53652
05/12/2025, 2:46 PMtall-airline-16756
05/12/2025, 2:47 PMfrom livekit.agents import Agent
from livekit.plugins import elevenlabs
class AgentWithVoice1(Agent):
def __init__(self):
super().__init__(instructions="You are an agent with voice 1.")
# Initialize with first voice
self.tts = elevenlabs.TTS(
voice_id="VOICE_ID_1",
model="eleven_multilingual_v2"
)
class AgentWithVoice2(Agent):
def __init__(self):
super().__init__(instructions="You are an agent with voice 2.")
# Initialize with second voice
self.tts = elevenlabs.TTS(
voice_id="ODq5zmih8GrVes37Dizd", # Example voice ID
model="eleven_multilingual_v2"
)
To implement the handoff:
@function_tool()
async def handoff_to_agent2(self):
"""Use this tool to hand off to agent with voice 2."""
# Return the new agent, which will use a different voice
return AgentWithVoice2()
When the handoff occurs, the new agent's voice settings will be applied automatically. Let me know if you need further assistance!
Sources: Tree View: | dse-workbench | Workflows | LiveKit Docs