这是我的程序
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
engine.setProperty('rate', 150)
def voice_alert(engine):
engine.say('please wear mask')
engine.runAndWait()
当 while 循环开始运行时调用 voice_alert 函数
while True:
if mask < withoutMask:
t = threading.Thread(target=voice_alert, args=(engine,))
t.start()
错误:
raise RuntimeError('run loop not started')
RuntimeError: run loop not started