import pyttsx3
engine = pyttsx3.init()
engine.say('Sally sells seashells by the seashore.')
engine.runAndWait() # 必须使用这行代码才能发出语音
engine.say('语音合成开始')
engine.say('1,2,3必须使用这行代码才能发出语音')
engine.runAndWait()
标签:文字,engine,pyttsx3,代码,say,runAndWait,语音
来源: https://www.cnblogs.com/fly-book/p/14771529.html