How can I change configuration of TTS OR STT assig...
# ask-ai
a
How can I change configuration of TTS OR STT assigned to VoicePipelineAgent in between the session? How do I use update_options in VoicePipelineAgent in my voice bot?
t
Thanks for reaching out, Hiren. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you understand how to dynamically change the TTS or STT configuration assigned to a
VoicePipelineAgent
during a session using the
update_options
method. This feature lets you easily adjust parameters like voice, language, speaking rate, pitch, and other provider-specific settings to better suit your needs. For instance, if you'd like to update the TTS settings, you can do it like this:
Copy code
session.tts.update_options(
    voice="Serena",
    speaking_rate=1.2,
    pitch=0.5,
    temperature=0.7
)
And for STT, you have the flexibility to modify transcription behavior on the fly:
Copy code
gladia_stt.update_options(
    languages=["es-ES"],
    interim_results=True,
    translation_enabled=True,
    translation_target_languages=["en"]
)
These updates will apply to the very next utterance or transcription. Just make sure your TTS/STT instance is active and linked to the session before calling
update_options
. Keep in mind, the available parameters can vary depending on the plugin you're using (like Inworld, Hume, Gladia). If you'd like, I can provide more details or specific examples tailored to your provider—just let me know! Sources: Hume TTS integration guide | LiveKit Docs | Gladia integration guide | LiveKit Docs | Tool definition and use | LiveKit Docs | Vision Agent Quickstart | LiveKit Docs | STT | LiveKit Agents