What’s your suggestion for handling multiple langu...
# ask-ai
m
What’s your suggestion for handling multiple languages with Cartesia? Is there a multilingual voice like elevenlabs? Or do I need to change the LLM or use update_options at runtime?
t
Thanks for reaching out, Alexander. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you asked about Cartesia TTS and its language capabilities! While it supports multiple languages, it does need you to explicitly set the language rather than automatically detecting it like ElevenLabs does. You can do this by using the
language
parameter with ISO-639-1 codes (for example, 'en' for English or 'es' for Spanish). If you're looking to switch languages on the fly, no worries! You can use the
update_options
method during runtime to change languages without having to restart the agent. Here's a quick example:
Copy code
self.tts.update_options(language="es")  # Switch to Spanish
For a smooth multilingual experience, you might consider: • Using a multilingual STT model to detect the language. • Processing the recognized text with an LLM that understands multiple languages. • Dynamically updating the TTS language with
update_options
. This way, you can enjoy seamless language switching throughout your session. If you'd like, I’m here to help with more details or examples—just let me know! Sources: Speech-to-text (STT) models | LiveKit Docs | pipeline-tts/changing_language/README.md | Cartesia TTS | LiveKit Docs | Cartesia TTS plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p...
m
Can I also update the voice parameter at runtime for Cartesia with update_options?
t
Absolutely! You can update the
voice
parameter at runtime for Cartesia using the
update_options
method. This makes it super easy to switch voices dynamically during your session. The
voice
parameter can be: • A voice ID string (for example,
"794f9389-aac1-45b6-b726-9d9369183238"
). • A custom voice embedding array. Here’s a quick example to guide you:
Copy code
self.tts.update_options(voice="794f9389-aac1-45b6-b726-9d9369183238")
Once you update it, the new voice will be used for the very next synthesized utterance. If you have any questions or want more examples, just let me know—I’m here to help! Sources: Hume TTS plugin guide | LiveKit Docs | plugins/cartesia/src/tts.ts | livekit-plugins/livekit-plugins-google/livekit/plugins/google/tts.py