speech_recognition icon indicating copy to clipboard operation
speech_recognition copied to clipboard

diffrent behavior of recognize_google on windows and ubuntu

Open yoad-ashuri opened this issue 3 years ago • 2 comments

hi, I am using this great package in windows and I'm trying to pass my code for remote AWS ec2 ubuntu server. my code goes like this:

filename = "temp.wav" r = sr.Recognizer() with sr.AudioFile(filename) as source: # listen for the data (load audio to memory) audio_data = r.record(source) # recognize (convert from speech to text) text = r.recognize_google(audio_data, language="en-US") print(text)

on windows, it's working well and recognizes my text as expected but when I run it I'm on the ubuntu server with the same file its returns different text and the incorrect one.

why this difference occurs and how can I resolve this problem.

thank you.

details: Ubuntu 18.04.5 LTS x64 Python 3.6.9 SpeechRecognition 3.8.1 pyaudio 0.2.11

yoad-ashuri avatar Nov 17 '21 16:11 yoad-ashuri

Did you test multiple times because recognise google works by sending the data to google through requests library. Google could have updated their recogniser between the two times.

Ccode-lang avatar May 26 '22 03:05 Ccode-lang

Another more likely possibility is that the microphones are different on the two computers.

Ccode-lang avatar May 26 '22 04:05 Ccode-lang