import speech_recognition
Robot_ear = speech_recognition.Recognizer()
with speech_recognition.Microphone() as mic:
print("Robot: I'm listening")
audio = Robot_ear.Listen(mic)
you = Robot_ear.Recognizer_google(audio)
print(you)
And I have an error: Traceback (most recent call last): File "C:\Users\admin\Documents\code\nghe.py", line 5, in audio = Robot_ear.Listen(mic) AttributeError: 'Recognizer' object has no attribute 'Listen'
Here is the updated code:
import speech_recognition
Robot_ear = speech_recognition.Recognizer()
with speech_recognition.Microphone() as mic:
print("Robot: I'm listening")
audio = Robot_ear.listen(mic)
you = Robot_ear.recognize_google(audio)
print(you)
I'll explain your errors,
First go through the documentation before you go to the programming
The errors are:
a)Use small letter in Listen
i.e listen
b) Use small letter in Recognize.google()
i.e recognize.google()