0

I am trying to work with the pyttx3 library and I am trying to output speech by supplying a text to engine.say('My text'), then I run the engine.runandwait() function but the program just stays there and does nothing.

Here is my code:

import pyttsx3

def speak(audio):
    engine.say(audio)
    engine.runAndWait()


engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
speak("Best")
Wolric
  • 701
  • 1
  • 2
  • 18
MAT
  • 1
  • 1
  • This could help [stuck in runAndWait](https://stackoverflow.com/questions/56032027/pyttsx3-runandwait-method-gets-stuck) – Aishe Feb 11 '23 at 06:24

0 Answers0