python SpeechRognizer
我目前正在研究自己的语音助手,但我经常有一个问题,即回答/认识到我什么都没说的需要很长时间。 我已经尝试使用:
listener.energy_threshold = 120
with sr.Microphone() as source:
listener.adjust_for_ambient_noise(source,duration=1)
但似乎没有帮助。
我的侦听器功能:
def take_command():
try:
with sr.Microphone() as source:
voice = listener.listen(source)
command = listener.recognize_google(voice, language="de")
command = command.lower()
except:
print("failed")
return command
通常,助手需要一分钟或更多时间来回答。
I'm currently working on my own voice assistant, but I often times have the problem that it's taking very long to answer/recognize that I'm not sayin anything.
I already tried using:
listener.energy_threshold = 120
with sr.Microphone() as source:
listener.adjust_for_ambient_noise(source,duration=1)
but it didn't seem to help.
My listener function:
def take_command():
try:
with sr.Microphone() as source:
voice = listener.listen(source)
command = listener.recognize_google(voice, language="de")
command = command.lower()
except:
print("failed")
return command
Oftentimes the assistant takes a minute or more to answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论