嘿,伙计们,我在使用pyttsx3时遇到了一点问题,几天前它还运行得很好,但现在它出现了一些问题。我设置了它的属性语音标记移动,但它听起来像zira每次我运行它
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('voice', 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN_-US_DAVID_11.0')
engine.say('Hello sir')
engine.runAndWait()发布于 2020-06-23 03:07:05
您的代码很接近,但您需要添加voices = engine.getProperty('voices')才能获得语音选项:
import pyttsx3
engine = pyttsx3.init()
voices = engine.getProperty('voices') # Get the options of voices
engine.setProperty('voice',voices[1].id) # Instead of the path use the variable defined above
engine.say('Hello sir')
engine.runAndWait()https://stackoverflow.com/questions/62521585
复制相似问题