Python 为什么循环已经在pyttsx3中启动

Python 为什么循环已经在pyttsx3中启动,python,django,pyttsx3,Python,Django,Pyttsx3,这是我的节目 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

这是我的节目

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