0

I have a problem with speech recognition in streaming mode. My audio source is a VoIP phone protocol (SIP), it allows you to output audio data in a format: "encoding": "Mulaw", "sampleRateHertz": 8000

  • When I send a new portion of data in streaming mode, an exception occurs: "Status(StatusCode=OutOfRange, Detail="Audio data is being streamed too slow. Please stream audio data approximately at real time.")"
  • For verification, I wrote the data to disk in this format. After I read the data and send it in chunks in a streaming mode, it all works correctly and the result is returned.

It turns out that the error appears only in realtime. I ask for help.

2 Answers2

0

I found the error. I opened the session and started sending the stream there in 5-10 seconds, because of this there was an error.

0

Audio streaming samplerate 8000 and RecognitionConfig.setSampleRate(8000) should sync same,

e.g., if audio streamed at 8000 and RecognitionConfig.setSamplerate(16000) - > results Audio streamed too slow

if audio streamed at 41000 and RecognitionConfig.setSamplerate(16000) - > results Audio streamed too fast