我正在尝试使 Uberi 识别语音(python)工作,但recognize_azure给了我错误。import speech_recognition as srr = sr.Recognizer()m = sr.Microphone()AZURE_SPEECH_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"with m as source: r.adjust_for_ambient_noise(source)print("Say something!")with m as source: audio = r.listen(source)try: print("Microsoft Azure Speech thinks you said " + r.recognize_azure(audio, key=AZURE_SPEECH_KEY))except sr.UnknownValueError: print("Microsoft Azure Speech could not understand audio")except sr.RequestError as e: print("Could not request results from Microsoft Azure Speech service; {0}".format(e))这是结果:AttributeError:'Recognizer' 对象没有属性'recognize_azure'
1 回答
偶然的你
TA贡献1841条经验 获得超3个赞
您正在使用speech_recognition
包的过期版本。recognize_azure
它还没有提供。
特别是目前在 pypi.org 上列出的包太旧了。您可能需要从源代码安装它,请参阅下面的 github 链接。
据我所知,自从 pypi 版本上市以来没有任何版本,所以你唯一的机会似乎是从 git master 安装。
见https://github.com/Uberi/speech_recognition/issues/385
添加回答
举报
0/150
提交
取消