Open anil2496 opened 6 years ago
It seems that the call to the Google Speech API is failing. I hope you know that r.recognize_google(audio)
uses a API from Google that is only for Chromium developers (or at least for people that are in the google group). You can reference the documentation for more details on the method.
Before using the Google APIs you must have set up all of their credential stuff.
I'm having issues with google cloud api not returning anything at all for certain audio files.
Example: https://drive.google.com/file/d/1XF5nQ2Nc7T6ODW0B198XrFLByRQG3fnY/view?usp=sharing
import speech_recognition as sr r = sr.Recognizer() harvard = sr.AudioFile('jackhammer.wav') with harvard as source: r.adjust_for_ambient_noise(source) audio = r.record(source) type(audio) print(r.recognize_google(audio))
showning error:
File "/home/anil/.local/lib/python2.7/site-packages/speech_recognition/init.py", line 844, in recognize_google raise RequestError("recognition connection failed: {}".format(e.reason)) speech_recognition.RequestError: recognition connection failed: [Errno -2] Name or service not known