uv add getstream-plugins-elevenlabs
ElevenLabs
ElevenLabs is a voice AI platform that offers advanced Text-to-Speech (TTS) capabilities with highly realistic and expressive voices.
It supports multiple languages and voices, making it ideal for real-time conversational agents, narrated content, accessibility tools, and voice-enabled applications.
The ElevenLabs plugin for the Stream Python AI SDK allows you to add TTS functionality to your project.
Installation
Install the Stream ElevenLabs plugin with
Example
Check out our Elevenlabs example to see a practical implementation of the plugin and get inspiration for your own projects, or read on for some key details.
Initialisation
The ElevenLabs plugin for Stream exists in the form of the ElevenLabsTTS
class:
from getstream.plugins.elevenlabs import ElevenLabsTTS
tts = ElevenLabsTTS()
Parameters
These are the parameters available in the ElevenLabsTTS plugin for you to customise:
Name | Type | Default | Description |
---|---|---|---|
api_key | str or None | None | Your ElevenLabs API key. If not provided, the plugin will look for the ELEVENLABS_API_KEY environment variable. |
voice_id | str | "VR6AewLTigWG4xSOukaG" | The ID of the voice to use for TTS. You can use any voice from your ElevenLabs account. |
model_id | str | "eleven_multilingual_v2" | The ID of the ElevenLabs TTS model to use. Controls the language and tone model for synthesis. |
Functionality
Send text to convert to speech
The send()
method sends the text passed in for the service to synthesize.
The resulting audio is then played through the configured output track.
tts.send("Demo text you want AI voice to say")