当我运行以下代码时,将生成错误。我尝试通过安装与操作系统相同的体系结构X64位并安装X32位。但这又给我一个错误
import pyttsx3
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
print(voices[0].id)
engine.setProperty('voice',voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
if __name__ == "__main__":
speak("harry is a boy")