Live Voice - before model callback, automatic-language-switch #2866
Replies: 1 comment
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The Hello! I see you're having an issue with changing the language of the voice output. Here's an explanation of what's happening and how you can fix it. The However, the voice output is synthesized by a separate text-to-speech (TTS) engine, and its configuration is managed by the To change the language of the synthesized voice, you need to update the Here is a conceptual example of how you might adjust the from adk.core import RunConfig, SpeechConfig
# Assuming you have your agent and other configurations set up
# When you need to switch the language to Spanish for voice output
spanish_speech_config = SpeechConfig(language_code="es-ES")
run_config_spanish = RunConfig(speech_config=spanish_speech_config)
# Now, run your agent with the updated RunConfig
agent.run_live(run_config=run_config_spanish)
# To switch back to English voice output
english_speech_config = SpeechConfig(language_code="en-US")
run_config_english = RunConfig(speech_config=english_speech_config)
agent.run_live(run_config=run_config_english) You can find more details on how to configure streaming and run configurations in the ADK documentation. [3] I hope this helps you resolve the issue! [1] https://google.github.io/adk-docs/callbacks/types-of-callbacks/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to apply before_model_callback in an agent, with model as gemini-live-2.5-flash-preview, and i am facing an issue, It works in the text based input for language switch, but for voice output, it returns in the original language[no switch].
What could be the Issue.
Beta Was this translation helpful? Give feedback.
All reactions