Hey guys in this video i am gonna tell you how you can convert text file to mp3 file using Python...
Source code...
first you need a text file which contain text..
#required module - pip install gtts
from gtts import gTTS
#opening a file
f = open("textfile.txt", 'r')
#passing file data
tts = gTTS(f.read())
#saving file as mp3
try:
tts.save("hello1.mp3")
except:
print("file not created")

0 Comments