Search This Blog

Text to Speech in python.pyttsx3

Text to Speech in python.pyttsx3

pip install pyttsx3

import pyttsx3

engine=pyttsx3.init()

voices=engine.getProperty('voices')
engine.setProperty('voice',voices[1].id)
f="hello world")
#f=open("your_file_path").read()

engine.say(f)

engine.runAndWait()