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

recognize_google_cloud API call takes 80 seconds on my Raspberry Pi 3B+ #712

Open
paulrmccarthy opened this issue Nov 17, 2023 · 2 comments

Comments

@paulrmccarthy
Copy link

I'm using the PyPi code ( https://pypi.org/project/SpeechRecognition/)

Cleaned up to use only Google Cloud SpeechRecognition.
I've enabled the Cloud Speech-to-Text API, got the Json credentials (local json file path set in shell's environment, and working), and the service calls ARE hitting & authenticating on the API. The Microphone is fine, and the recording bit happens quickly.

However, its taking fully 80 seconds to perform the API call! The Pi is connected on ether to fast fibre router.

I've monitored the network traffic, and I can see that the API connection kinda sits idle for 78 seconds, and then TX/RXs really fast in the final 2 seconds. How can I speed this up?

Can it be slow-authentication handshake that I might mend? Is it the Pi?
Python 3.9, Rasbian OS 2023.

Thanks a mil!

The delay happens on the 2nd last line here:

print("0 seconds")
try:
print("Google Cloud Speech thinks you said " + r.recognize_google_cloud(audio)
print("80th second")

@gadzw
Copy link

gadzw commented Nov 19, 2023

I'm having the same problem with Google Speech Recognition, but in a Windows 10 machine but it only takes about 14-ish second to be ready. Can someone help?

@EclipseGame18
Copy link

i would try using recognize_vosk, it can work offline and is very fast. it does however require you to install models for it to work off, however, the gains are great and it is pretty accurate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants