Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speech_streaming.py got Error from server: Audio data is being streamed too fast. #364

Closed
erichuang2013 opened this issue Jun 2, 2016 · 5 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@erichuang2013
Copy link

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.

@jerjou
Copy link
Contributor

jerjou commented Jun 2, 2016

Hello- can you paste in the command-line you're using to invoke the script?

@erichuang2013
Copy link
Author

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
Copy link

kotobuki commented 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'.

$ 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.

@jerjou
Copy link
Contributor

jerjou commented 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 RATE constant to a rate that is supported.

@jerjou
Copy link
Contributor

jerjou commented Jul 26, 2016

Closing this for now. Feel free to reopen if that doesn't solve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants