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?
Google Speech 400 Audio Timeout Error: Long duration elapsed without audio
- Google Speechservice
- streaming recognitionservice
- googleapis/python-speechlibrary
- long audio transcriptionservice
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
Source: https://github.com/googleapis/python-speech/issues/209