pyttsx3 pywintypes.com_error

@[TOC](pyttsx3 pywintypes.com_error: (-2147221005, ‘无效的类字符串’, None, None))

系统环境

系统:win7
python版本:python 3.7.1 64位

与python版本的关系

通过多台电脑测试,此报错与python版本没有关系!

报错信息

Traceback (most recent call last):
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\__init__.py", line 44, in init
    eng = _activeEngines[driverName]
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\weakref.py", line 137, in __getitem__
    o = self.data[key]()
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
    IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221005, '无效的类字符串', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/cyfAI/pro_ject/python/speech/speech.py", line 4, in <module>
    engine = pyttsx3.init()
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\__init__.py", line 46, in init
    eng = Engine(driverName, debug)
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\engine.py", line 52, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\driver.py", line 77, in __init__
    self._driver = self._module.buildDriver(weakref.proxy(self))
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\drivers\sapi5.py", line 22, in buildDriver
    return SAPI5Driver(proxy)
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\pyttsx3\drivers\sapi5.py", line 26, in __init__
    self._tts = win32com.client.Dispatch('SAPI.SPVoice')
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "E:\Program Files\DevelProgram\Python\envs\py3_venvs\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, '无效的类字符串', None, None)

报错原因

通过打开讲述人,发现也是无法打开的,那么就有理由怀疑语音引擎有问题

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值