this is an old code and it was working before but when I tried to restart the project it gives me this error
ImportError: No module named pyttsx3
this is the code I use VScode and have used pip install pyttsx3
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 180) # setting up new voice rate
engine.setProperty('volume', 1.0) # settin up the volume
voices = engine.getProperty('voices') #getting details of current voice
engine.setProperty('voice', voices[0].id) #changing index, changes voices. 1 for male , 0 for female
def speak(audio):
engine.say(audio)
engine.runAndWait()