Description
In which file did you encounter the issue?
Did you change the file? If so, how?
Yes, to use arecord instead of pyaudio/portaudio. You can find the modified file (transcribe_streaming_arecord.py) attached to 7th comment of #728
Describe the issue
When the script was run, it throws the following error on regular basis. We are testing this from NAO robot mic and NAOqi OS (distribution based on Gentoo OS).
(env) nao [err 1] ~/googlespeech $ stdout: Broken pipe
python transcribe_streaming_arecord.py
Recording raw data 'stdin' : Signed 16 bit Little Endian, Rate 14000 Hz, Mono
/var/persistent/home/nao/googlespeech/env/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:334: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
SNIMissingWarning
/var/persistent/home/nao/googlespeech/env/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:132: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
I would like to make a cash deposit
Traceback (most recent call last):
File "transcribe_streaming_arecord_20161222.py", line 224, in <module>
main()
File "transcribe_streaming_arecord_20161222.py", line 215, in main
listen_print_loop(recognize_stream)
File "transcribe_streaming_arecord_20161222.py", line 164, in listen_print_loop
raise RuntimeError('Server error: ' + resp.error.message)
RuntimeError: Server error: Audio data is being streamed too fast. Please stream audio data approximately at real time.
Mic is identified properly as seen in the following command.
(env) nao [0] ~/googlespeech $ arecord --list-devices
**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: AD198x Analog [AD198x Analog]
Subdevices: 0/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
And sound driver supports sampling rates exceeding 48k.
(env) nao [err 1] ~/googlespeech $ pactl list short sinks
0 alsa_output.0.output-speakers module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
We have also observed that google server has complained about streaming too fast or slow even for same rate (e.g. 16k) at different times. Only difference between these tests was that the network latency kept changing and was high in general. Can the above error be caused by unstable network bandwidth? Is there any solution or workaround to use streaming under a bad network condition. Can any other factors cause this error?