|
@@ -21,6 +21,8 @@ class OrderListener:
|
|
|
|
|
|
r = sr.Recognizer()
|
|
|
with sr.Microphone() as source:
|
|
|
+
|
|
|
+ r.adjust_for_ambient_noise(source)
|
|
|
print("Say something!")
|
|
|
audio = r.listen(source)
|
|
|
|
|
@@ -29,7 +31,7 @@ class OrderListener:
|
|
|
|
|
|
|
|
|
|
|
|
- print("Google Speech Recognition thinks you said " + r.recognize_google(audio))
|
|
|
+ print("Google Speech Recognition thinks you said " + r.recognize_google(audio, key=None, language="fr-FR"))
|
|
|
except sr.UnknownValueError:
|
|
|
print("Google Speech Recognition could not understand audio")
|
|
|
except sr.RequestError as e:
|