如何修复python 3.8中的pyttsx3模块错误

问题描述

在我的 python 3.8.5 虚拟环境中使用 pyttsx3 模块时,此代码如下:

source_0

我在编译以上代码时遇到此错误:

import pyttsx3

def speak(speak):
    engine = pyttsx3.init()
    voices = engine.getProperty('voices')
    engine.setProperty('voice',voices[1].id)
    engine.getProperty('rate')
    engine.setProperty('rate',155)
    engine.say(speak)
    engine.runAndWait()

speak("Hello")

每次运行给定的python代码时,都会发生上述错误,并且我在Windows 10中使用VS代码作为我的编码IDE。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)