0
Tell me about module "pyttsx3" in python
2 Answers
+ 2
Pyttsx3 stands for Python text to speech. This will help you in programs where you want to speak something. Here is the basic demonstration.
First 'pip install pyttsx3 or python -m pip install pyttsx3' in the command prompt or terminal(search it in the search bar if you don't know where it is)
import pyttsx3
engine=pyttsx3.init("sapi5")
voices=engine.getProperty("voices")
engine.setProperty("voice",voices[1].id)
def speak(text):
engine.say(text)
engine.runAndWait()
speak('Hello world')