Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更改 pyttsx3 中的重音?
我已经成功地尝试改变声音和它提供语音的速度。
import pyttsx3 engine=pyttsx3.init() voice=engine.getProperty('voices')[0] engine.setProperty('voice',voice.id) engine.setProperty('rate',100) engine.say("Hello there!") engine.runAndWait()
口音的变化。
你可以试试这段代码:
import pyttsx3 engine = pyttsx3.init() voices = engine.getProperty('voices') for voice in voices: print(voice, voice.id) engine.setProperty('voice', voice.id) engine.say("Hello World!") engine.runAndWait() engine.stop()