------------------------------------------------------------
firstly install pip install pyttsx3 in cmd
------------------------------------------------------------
A SUDHIR TAWANIYA PRODUCT
------------------------------------------------------------
import pyttsx3
def say():
global engin
engin = pyttsx3.init()
voices=engin.getProperty('voice')
engin.setProperty('voice',voices[0])
engin.setProperty('rate',130)
def open_file():
with open("file_name") as file_object:
for line in file_object.readlines():
print(line)
engin.say(line)
engin.runAndWait()
say()
open_file()
Great!
ReplyDeleteNice 👍
ReplyDeleteThis comment has been removed by the author.
ReplyDelete