Python 中的语音识别

发布于 2024-09-14 17:30:25 字数 1015 浏览 7 评论 0原文

我找到了语音模块,我可以让我的电脑说出我写的东西。但问题是当我尝试这里的示例代码时: http://pypi. python.org/pypi/speech/0.5.1 它给了我一个错误并且无法做到这一点。这是我得到的错误:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
response = speech.input("Say something, please.")
File "build\bdist.win32\egg\speech.py", line 162, in input
listener = listenforanything(response)
File "build\bdist.win32\egg\speech.py", line 193, in listenforanything
return _startlistening(None, callback)
File "build\bdist.win32\egg\speech.py", line 222, in _startlistening
context = _recognizer.CreateRecoContext()
File "C:\Python26\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4.py", line 2648, in CreateRecoContext
ret = self._oleobj_.InvokeTypes(10, LCID, 1, (9, 0), (),)
com_error: (-2147352567, 'Exception raised.', (0, None, None, None, 0, -2147200905),    None)

我真的希望有人可以帮助我。

预先非常感谢,

杰克

I found the speech module and i can get my computer to say the stuff i write. But the problem is when i try out the example code from here: http://pypi.python.org/pypi/speech/0.5.1 It gives me an error and can't do it. This is the error i get:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
response = speech.input("Say something, please.")
File "build\bdist.win32\egg\speech.py", line 162, in input
listener = listenforanything(response)
File "build\bdist.win32\egg\speech.py", line 193, in listenforanything
return _startlistening(None, callback)
File "build\bdist.win32\egg\speech.py", line 222, in _startlistening
context = _recognizer.CreateRecoContext()
File "C:\Python26\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x4.py", line 2648, in CreateRecoContext
ret = self._oleobj_.InvokeTypes(10, LCID, 1, (9, 0), (),)
com_error: (-2147352567, 'Exception raised.', (0, None, None, None, 0, -2147200905),    None)

I really hope someone can help me.

Thanks alot in advance,

Jake

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

病毒体 2024-09-21 17:30:25

为了使语音模块正常工作,您还必须安装 pywin32。

In order for the speech module to function properly you must also install pywin32.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文