Hey I am facing an issue where i am using google t...
# ask-ai
h
Hey I am facing an issue where i am using google tts livekit plugins and i generated a credential file in form of json i use that as the auth. I am facing issue that whenever i start the call the google tts speaks and suddenly throws a timeout issue which i am unable to figure out why. I tried reaching google suppport and they mentioned this is not their side issue rather its something breaking in livekit side can someone help me out to resolve this issue ?
t
Thanks for reaching out, Sahil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I hear your frustration. You said Google TTS starts speaking and then a timeout occurs, and Google support told you the issue is happening on the LiveKit side. I can help troubleshoot — to narrow this down I need a few details, and I’ll list practical checks you can run right away. Quick checks you can run now • Verify the credentials file works outside LiveKit: run a simple Google TTS request using the same JSON credentials in a minimal script or curl test. This isolates Google vs LiveKit. • Confirm API access & quotas: ensure the service account in your JSON has the Text-to-Speech API enabled and sufficient quota. • Test network/latency: run a traceroute or ping from your server to the Google Cloud region you’re calling to check for high latency or packet loss. • Try smaller/streaming payloads: if you synthesize a short sentence does it still timeout? If long text, break into smaller chunks or use streaming if supported. What I need from you to diagnose further 1. Exact error message and stack trace (copy/paste). The precise timeout wording and where it’s thrown helps locate whether it’s from the TTS client, the LiveKit plugin, or network. 2. The TTS configuration snippet you’re using (redact secrets). For example, how you pass credentials:
credentials_file
, env var
GOOGLE_APPLICATION_CREDENTIALS
, or
credentials_info
. 3. Does the timeout happen after a consistent duration (e.g., always ~30s)? Or randomly? 4. Are you running LiveKit Cloud or a self-hosted LiveKit server? If self-hosted, what region and network setup is the server in? 5. Whether you see any LiveKit agent logs or metrics around the time of the timeout (request/response times, errors). Possible causes and short-term mitigations • Credentials/permission issue: Ensure the service account has Text-to-Speech enabled. If credentials fail mid-request, Google TTS might start streaming audio then fail on a follow-up call. • Network/latency/timeouts: Agent latency and proximity to Google endpoints matter. If your LiveKit instance is far from the Google endpoint you’re using, requests can time out. Deploy closer or increase timeouts if possible. • Frame size / streaming settings: Very large batched requests can cause longer processing times. Try smaller frame sizes (Google recommends 100ms but smaller may work better in practice) or stream in small chunks. • Recoverability: Add retries or a fallback TTS provider so a single failed request doesn’t drop the audio mid-call. If you want, send the error log and your config snippet and I’ll look through them and propose the exact code/config changes to test next. I can also suggest a small reproducible test you can run locally to prove whether the issue is LiveKit integration vs Google credentials/network. Sources: Google Cloud TTS integration guide | LiveKit Documentation | Agents Framework | livekit/livekit_composite | DeepWiki | Live Conversations with AI using ChatGPT and WebRTC | Python Agents: Handling exceptions in your entrypoint | LiveKit