我使用pyttsx3库,它减慢了runAndWait()的速度。
解决办法是什么?
PS:Pyttsx3 runAndWait() method gets stuck -我看过了,没什么用
def speak(what):
speak_engine.say(what)
speak_engine.runAndWait() # stop!
speak_engine.stop()
speak.start("Hello world!")发布于 2022-01-23 17:24:33
我认为这应该是可行的:
import pyttsx3
def speak(voice):
engine = pyttsx3.init()
rate = engine.getProperty('rate')
engine.setProperty('rate', rate + 1)
engine.setProperty('voice', 'com.apple.speech.synthesis.voice.Alex')
engine.say(voice)
engine.runAndWait()
speak("Hello")https://stackoverflow.com/questions/70326353
复制相似问题