My python version is 3.7 and Pyaudio version is 2.7 Program is totally running during engine init, but I can't use sipas5 for windows so I have used dummy
import pyttsx3
engine = pyttsx3.init("dummy")
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(text):
print('Rex:' + text)
engine.say(text)
engine.runAndWait()
print("On")
speak("This program is running perfectly")
print("End")
Output
On
Rex:This program is running perfectly
End
Process finished with exit code 0