pyttsx3
This line of code was suggested to me by chatgpt to make a program speak. But nothing happens when it’s executed.Can someone see why?
def speak_text(text): engine = pyttsx3.init() engine.say(text) engine.runAndWait()
while True: user_input = input("Enter a word or phrase (or 'q' to quit): ") if user_input.lower() == 'q': break speak_text(user_input)