Uberi / Uberi/speech_recognition

Unable to connect to google API when using recognize_google()

Open
#830 4 comments 0 reactions 1 assignee View on GitHub

@Unknownuserfrommars is already working on this.

Since Mar 4, 2025.

Dominant language
Python
Stars
9k
Forks
2.4k
Avg merge
12h 24m
Merged PRs (30d)
3

Description

Steps to reproduce

My code
I used yt-dlp and some processessing and let SR recognize the text, but when i tried to call recognize_google(), an errored occured: Error reading video: Unable to connect Google API
Specifically, in this line of code.
Somehow, this error passed my try...except block for sr.UnknownValueError and sr.RequestError. Instead, it went to the end of the major try-except block starting from L277.
Was it my connection? But i double and triple-checked everything. Network no issue for me

Btw, as a reference, the link to my project is: https://lightningroute-fe.streamlit.app/

Expected behaviour

Recognize the audio and turn into text

Actual behaviour

Error

Error reading video: Unable to connect Google API

(This is hosted by streamlit, so i used a st.error() to display the error message instead of in the terminal)

System information

(Delete all the statements that don't apply.)

My system is Windows 11 24H2 (x64).

My Python version is 3.12.9 (In Streamlit Cloud).

My Pip version is Don't know, Streamlit Cloud doesn't have a interactive shell. (You can check this by running pip -V.)

My SpeechRecognition library version is 3.14.1.

My PyAudio library version is I don't have PyAudio installed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.