how do i update tts options when using a tts fallb...
# ask-ai
t
how do i update tts options when using a tts fallback adapter
t
Thanks for reaching out, Joseph. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I understand you'd like to update TTS options when using the
FallbackAdapter
. While the
FallbackAdapter
itself doesn't directly support updating TTS options for its managed instances, you can definitely update each TTS instance individually using their
update_options
methods, either before or during operation. Here's a quick example to illustrate:
Copy code
google_tts = GoogleTTS()
google_tts.update_options(voice_name="en-US-Wavenet-D", speaking_rate=1.2)

hume_tts = HumeTTS()
hume_tts.update_options(speed=1.1, description="calm and clear voice")

fallback_adapter = FallbackAdapter([google_tts, hume_tts])
Another approach is to keep references to your TTS instances so you can update them individually while your program is running. Or, if needed, you might reconstruct the
FallbackAdapter
with the updated instances. If you find yourself needing to update options frequently, it could be helpful to create a custom wrapper that automatically propagates changes to all your managed TTS instances. I hope this helps! Feel free to ask if you'd like me to walk you through any of these steps. Sources: livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/tts.py | Agent Testing & CI/CD | livekit/livekit_composite | DeepWiki