Python中的语音识别
我找到了一个语音模块,可以让我的电脑说出我写的内容。但是,当我尝试这里的示例代码时: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)
我真的希望有人能帮我。
非常感谢,
Jake
1 个回答
0
为了让语音模块正常工作,你还需要安装pywin32这个东西。