import pyttsx3
with open (‘word.txt‘,encoding=‘utf-8‘) as obj:
line=obj.readline()
engine=pyttsx3.init()
rate=engine.getProperty(‘rate‘)
engine.setProperty(‘rate‘,160)
volume=engine.getProperty(‘volume‘)
engine.setProperty(‘volume‘,0.6)
engine.say(line)
engine.save_to_file(line,‘abc.mp3‘)
engine.runAndWait()