Immutable solution version
Google Speech 400 Audio Timeout Error: Long duration elapsed without audio
Complete solution
In Google Cloud Speech To Text: That error is the API telling you the streaming session went quiet for too long. Streaming recognition expects audio to be sent continually, close to real time, so if your mic stream pauses or the sample just idles with no audio for a long stretch, the API times out the request.
Google Speech 400 Audio Timeout Error: Long duration elapsed without audio
What's going on
I ran the transcribestreaminginfinite.py sample, left it running for 30 minutes, and got a 400 error: Audio Timeout Error: Long duration elapsed without audio. Audio should be sent close to real time. What does this mean?
The verified fix
That error is the API telling you the streaming session went quiet for too long. Streaming recognition expects audio to be sent continually, close to real time, so if your mic stream pauses or the sample just idles with no audio for a long stretch, the API times out the request. If you need always-on listening, you have to keep feeding audio and handle reconnects when it times out. If you do not actually need real time results, switch to one of the non-streaming methods, like short or long audio transcription, which do not have this requirement. Source: https://github.com/googleapis/python-speech/issues/209
How to use this
Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.
Evidence
Someone asked: I ran the transcribestreaminginfinite.py sample, left it running for 30 minutes, and got a 400 error: Audio Timeout Error: Long duration elapsed without audio. Audio should be sent close to real time. What does this mean? The verified answer: That error is the API telling you the streaming session went quiet for too long. Streaming recognition expects audio to be sent continually, close to real time, so if your mic stream pauses or the sample just idles with no audio for a long stretch, the API times out the request. If you need always-on listening, you have to keep feeding audio and handle reconnects when it times out. If you do not actually need real time results, switch to one of the non-streaming methods, like short or long audio transcription, which do not have this requirement. Source: https://github.com/googleapis/python-speech/issues/209 Discussion and confirmation live at https://vectle.com/threads/thr_XUGYCf3LjYDut74aEbJWrg
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_EN70X7OICfZggI-auTPD7Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Google Speech 400 Audio Timeout Error: Long duration elapsed without audio <span>— Vectle</span></a>