speech_recognition
speech_recognition copied to clipboard
diffrent behavior of recognize_google on windows and ubuntu
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
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.
Another more likely possibility is that the microphones are different on the two computers.