You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
speech_streaming.py got Error from server: Audio data is being streamed too fast. #364
When running python-docs-samples/speech/api/speech_streaming.py, always got the same error from the server after connection is fired. Computer environment is windows 10 w/ ptyhon 2.7.11.
C:\Users\Eric\Downloads\chrome\python-docs-samples\speech\api>python speech_streaming.py
[transcript: "hi"
]
Traceback (most recent call last):
File "speech_streaming.py", line 146, in
main()
File "speech_streaming.py", line 138, in main
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))
File "speech_streaming.py", line 116, 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.
I have got this Error just after few words response arrived.
I reproduced same issue with Python 2.7.11 on MacOS 10.11.5 as follows:
In this case, I said 'my name is Shigeru'.
$ python speech_streaming.py
2016-06-12 08:37:19.694 Python[47690:2749756] 08:37:19.693 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
[transcript: "my"
]
[transcript: "man"
]
[transcript: "my name"
]
[transcript: "my name is"
]
[transcript: "my name is she"
]
[transcript: "my name"
]
[transcript: " is she"
]
[transcript: "my name"
]
[transcript: " is Sugar"
]
Traceback (most recent call last):
File "speech_streaming.py", line 145, in <module>
main()
File "speech_streaming.py", line 137, in main
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))
File "speech_streaming.py", line 116, 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.
One more example. In this case, I said 'hello'.
$ python speech_streaming.py
2016-06-12 08:29:16.502 Python[47618:2745227] 08:29:16.501 WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
Traceback (most recent call last):
File "speech_streaming.py", line 145, in <module>
main()
File "speech_streaming.py", line 137, in main
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))
File "speech_streaming.py", line 116, 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.
In my environment, this occurs with a probability of one thirds.
Hm... when I've encountered this error, it's been because the sample rate I specified was different from the actual sample rate that my mic was sampling at. If you're running the sample unmodified, though, it should be specifying the sample rate when it opens the device, and passing that same rate to the api in the initial request..
Perhaps the given rate (16000) isn't supported by your audio device? It looks like you can query your device to see what rates are supported - can you try that? You should get a list of supported sample rates, and if 16000 isn't one of them, you can modify the RATE constant to a rate that is supported.
Activity
jerjou commentedon Jun 2, 2016
Hello- can you paste in the command-line you're using to invoke the script?
erichuang2013 commentedon Jun 2, 2016
C:\Users\Eric\Downloads\chrome\python-docs-samples\speech\api>python speech_streaming.py
[transcript: "hi"
]
Traceback (most recent call last):
File "speech_streaming.py", line 146, in
main()
File "speech_streaming.py", line 138, in main
service.Recognize(request_stream(stop_audio), DEADLINE_SECS))
File "speech_streaming.py", line 116, 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.
I have got this Error just after few words response arrived.
kotobuki commentedon Jun 11, 2016
I reproduced same issue with Python 2.7.11 on MacOS 10.11.5 as follows:
In this case, I said 'my name is Shigeru'.
One more example. In this case, I said 'hello'.
In my environment, this occurs with a probability of one thirds.
jerjou commentedon Jul 13, 2016
Hm... when I've encountered this error, it's been because the sample rate I specified was different from the actual sample rate that my mic was sampling at. If you're running the sample unmodified, though, it should be specifying the sample rate when it opens the device, and passing that same rate to the api in the initial request..
Perhaps the given rate (16000) isn't supported by your audio device? It looks like you can query your device to see what rates are supported - can you try that? You should get a list of supported sample rates, and if 16000 isn't one of them, you can modify the
RATEconstant to a rate that is supported.jerjou commentedon Jul 26, 2016
Closing this for now. Feel free to reopen if that doesn't solve it
chore(deps): update dependency google-cloud-documentai to v2 (#364)
chore(deps): update dependency google-cloud-documentai to v2 (#364)
chore(deps): update dependency google-cloud-documentai to v2 (#364)
chore(deps): update dependency google-cloud-documentai to v2 (#364)
chore(deps): update dependency google-cloud-pubsub to v2.7.0 (#364)
migrate code from googleapis/python-logging (#13844)