带有抽象类的错误(实现错误)

时间:2019-05-24 04:19:29

标签: python python-2.7

我正在制作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

0 个答案:

没有答案