Gemini Live API (v3.1) suddenly stops streaming audio response intermittently
I’m currently building a real-time AI calling/voice interaction platform using the Gemini Live 3.1 model. The pipeline involves continuous streaming (input → model → TTS/audio output).
However, I’m facing an intermittent issue where the model suddenly stops speaking/outputting audio, and this happens at random times (no consistent duration or trigger).
Details:
The issue is not time-specific (can happen early or after a longer interaction)
No explicit error is thrown when this happens
The pipeline just silently stops producing audio output
Connection appears to remain active (in some cases)
My Setup:
Real-time streaming (likely via WebSocket / streaming API)
Continuous input/output loop
TTS layer for audio playback
What I’ve Checked:
No obvious crashes in the application
No clear API error responses
Happens even with stable input
Questions:
Is there any known timeout/session limit for Gemini Live streaming?
Could this be due to stream interruptions or buffering issues?
Are there recommended best practices for handling:
auto-reconnect
keep-alive/heartbeat
stream recovery?
How can I reliably detect whether the issue is from:
the model stopping generation
or the audio/TTS pipeline failing?
Any guidance, debugging strategies, or similar experiences would be really helpful.
Thanks!
I am also facing the same issue, what is the error you are getting from websocket?
Your audio is silently dying because of session/connection timeouts**.** The Gemini Live API cuts you off at ~10 min (WebSocket) or 15 min (audio session) with zero error , it just stops.
Three things to do:
Enable context window compression , This can prevent abrupt termination during long sessions.
Use session resumption , store the resumption token the server sends and reconnect with it so the session survives WebSocket resets.
Listen for
GoAwaymessages , the server warns you before it drops the connection, so you can reconnect gracefully instead of silently dying.
Also, if audio stops but you never see generationComplete fire, that's your signal the issue is the connection, not the model.
I don't see any web socket errors, the ai model just stops talking in the middle of the conversation after 1-2 minutes continues to speak
I also facing same issue , no complete sentence like that
hello, How are . I think it's quota problem.
So, I change to vertext AI and problem is solved.
But Vertex AI is support gemini 2.5 and have some issue.
Sometime trigger search tool and crack. Another error is not response anything and send Turn Complete signal.