我正在制作AI机器人。及其显示:
NotImplementedError: this is an abstract class
这是我的代码:
def read_voice_cmd():
print('Listening...')
# it is priniting listening and after that code is:
with sr.Recognizer() as source :
audio = speech.listen(source)
try :
voice_text = speech.recognize_google(audio)
except sr.UnknownValueError :
pass
except sr.RequestError:
print ('Network Error')
return voice_text