Forums

PYTHON DOES NOT SPEAK

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)

The code is running on a server somewhere rather than your computer. There's no link to your speaker. Maybe there's a server somewhere in an AWS speaking and freaking out an aws sysadmin..