AttributeError:“Recognizer”对象没有“Recognizer\u azure”属性

2024-06-09 18:59:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图让Uberi识别语音(python)工作,但是recognize_azure给了我错误。你知道吗

import speech_recognition as sr

r = 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' object has no attribute 'recognize_azure'

西班牙:

Estoy tratando de hacer functionar speech\u recognition de Uberi(python),pero el recognition\u azure me da errors.这是一种语音识别技术。你知道吗

埃斯特•埃斯托伊•埃斯托伊•乌桑多:ver arriba

结果如下:

AttributeError: 'Recognizer' object has no attribute 'recognize_azure'


Tags: sourceas语音azureaudiospeechmicrosoftprint
1条回答
网友
1楼 · 发布于 2024-06-09 18:59:57

您使用的是过期版本的speech_recognition包。recognize_azure尚未由它提供。你知道吗

特别是目前列在pypi.org网站太老了。您可能需要从源代码安装它,请参阅下面的github链接。你知道吗

据我所知,自从pypi版本上市以来,还没有发布过任何版本,所以您唯一的机会似乎是从git主机安装。你知道吗

https://github.com/Uberi/speech_recognition/issues/385

相关问题 更多 >