Overview
ElevenLabs provides an AI text-to-speech (TTS) service with thousands of human-like voices across a number of different languages. With LiveKit's Elevenlabs integration and the Agents framework, you can build AI voice applications that sound realistic.
Quick reference
Environment variables
ELEVENLABS_API_KEY=<your-elevenlabs-api-key>
TTS
LiveKit's ElevenLabs integration provides a text-to-speech (TTS) interface. This can be used in a VoicePipelineAgent
or as a standalone speech generator. For a complete reference of all available parameters, see the plugin reference.
Usage
from livekit.plugins.elevenlabs import ttseleven_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",streaming_latency=3,enable_ssml_parsing=False,chunk_length_schedule=[80, 120, 200, 260],)
Parameters
ID of the model to use for generation. To learn more, see the ElevenLabs documentation.
Voice configuration. To learn more, see the ElevenLabs documentation.
ID of the voice to use for generation. To learn more, see the ElevenLabs documentation.
See the ElevenLabs documentation.
Language of output audio in ISO-639-1 format. To learn more, see the ElevenLabs documentation.
Latency in seconds for streaming.
Enable SSML parsing for input text.
Schedule for chunk lengths. Valid values range from 50
to 500
.