jolly-apartment-95291
07/23/2025, 4:08 PMtall-airline-16756
07/23/2025, 4:08 PMtall-airline-16756
07/23/2025, 4:09 PMRimeAgent and an ElevenLabsAgent, each with its own TTS configuration, and provide a function tool to switch between them at runtime.
• Using `session.update_agent()`: Programmatically switch agents with different TTS engines by calling session.update_agent() and passing a new agent instance with the desired TTS configuration.
• Updating TTS Options Within the Same Engine: For some providers (like Hume), you can update parameters such as voice, description, or speed during the session using session.tts.update_options(). The changes take effect on the next utterance.
Switching agents is the most flexible method, as it allows you to change not only the TTS provider but also other agent parameters as needed. Each agent can include an on_enter() method to announce the switch and confirm the new TTS voice.jolly-apartment-95291
07/23/2025, 4:11 PMtall-airline-16756
07/23/2025, 4:12 PMupdate_options method. It's like having a voice chameleon that can change on the fly!
Check out this neat example with Hume TTS:
session.tts.update_options(
voice=hume.VoiceByName(name="Colton Rivers", provider=hume.VoiceProvider.hume),
description="The voice exudes calm, serene, and peaceful qualities, like a gentle stream flowing through a quiet forest.",
speed=2,
)
And guess what? This isn't just a Hume thing! Other engines like Cartesia, Google, Neuphonic, LMNT, Speechify, and Inworld also support update_options with their own voice tweaks. Pretty flexible, right?
The best part? You can adjust your TTS voice based on what's happening in your session, all without the hassle of switching engines or starting over. How cool is that?
Sources: Hume TTS integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/tts.py | agent/main.py