google tts is talking in gibberish when i ask it t...
# ask-ai
d
google tts is talking in gibberish when i ask it to speak in regional indian languages but when i check the logs the output of the llm are correct, to double check i pasted the output in google cloud and it spoke correctly. What could be going wrong? Here is a example output -
Copy code
ಖಾತರಿಯದು ನಮಗೆ ಈ ಕೆಳಗಿನ ಕೊಠಟಿಯ ಪ್ರಕಾರಗಳನ್ನು ನೀಡುತ್ತೇವೆ ಪ್ರೀಮಿಯಮ್ ರೂಮ್ ಟ್ವಿನ್ ಪ್ರೀಮಿಯಮ್ ರೂಮ್ ಕ್ಲಬ್ ಸೂಟ್ ಮತ್ತು ಕಿಮ್ಮನೆ ಸುಟ್ ನೀವು ಯಾವটি ಆಯ್ಕೆ ಮಾಡುತ್ತೀರಿ
t
Thanks for reaching out, Harsha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Could you help me understand a bit more about how you're integrating Google TTS with your app? Just a few quick questions: • Are you doing any extra processing or changes to the text before sending it to Google TTS? • Which API or SDK version of Google TTS are you working with? • Do you specify the language code when you make the TTS request? Knowing these details will really help us figure out if there’s anything up with the integration or settings. Thanks a bunch!
d
I am using this code -
Copy code
tts = google.TTS(gender="female", voice_name="en-US-Chirp-HD-F"),
t
Hey there! The voice configuration
en-US-Chirp-HD-F
is made specifically for English (US). If you're trying to use it for regional Indian languages, it might not work as smoothly. Could you try setting the language code explicitly for the Indian language you're aiming for (like
kn-IN
for Kannada) and use a voice that's designed for that language? Give it a shot, and let me know if that helps or if you want me to walk you through the setup. I'm here to help! Sources: livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/models.... | Sarvam TTS integration guide | LiveKit Docs
d
In the google cloud website when i pasted the same text for this voice, it worked well
t
Hey there! I noticed the text works fine on the Google Cloud website but not through the API. Just to help figure this out, could you please confirm a couple of things for me? • Are you using the same text input and language settings in both places? • Are there any extra parameters or settings in your API request that might be different from the website setup? • If you don’t mind, could you share the exact API request payload (just make sure to leave out any sensitive info) so we can spot any differences?
d
what does this error mean -
Copy code
2025-09-04 05:50:32,582 - ERROR livekit.agents - Error in _tts_inference_task
Traceback (most recent call last):
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/tts/tts.py", line 529, in __anext__
    val = await self._event_aiter.__anext__()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopAsyncIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venv/lib/python3.13/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper
    return await func(*args, **kwargs)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/voice/generation.py", line 212, in _tts_inference_task
    async for audio_frame in tts_node:
    ...<3 lines>...
        audio_ch.send_nowait(audio_frame)
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/voice/agent.py", line 412, in tts_node
    async for ev in stream:
        yield ev.frame
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/tts/tts.py", line 532, in __anext__
    raise exc  # noqa: B904
    ^^^^^^^^^
  File "/root/.venv/lib/python3.13/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper
    return await func(*args, **kwargs)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venv/lib/python3.13/site-packages/livekit/agents/tts/tts.py", line 357, in _main_task
    await self._run(output_emitter)
  File "/root/.venv/lib/python3.13/site-packages/livekit/plugins/google/tts.py", line 339, in _run
    await asyncio.gather(*tasks)
  File "/root/.venv/lib/python3.13/site-packages/livekit/plugins/google/tts.py", line 332, in _run_segments
    await self._run_stream(input_stream, output_emitter, streaming_config)
  File "/root/.venv/lib/python3.13/site-packages/livekit/plugins/google/tts.py", line 382, in _run_stream
    await input_gen.aclose()
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!