from gtts import gTTS
import os
myText = "Welcome on my tutorial on google text to speech"
myTextImport = open("text.txt", "r")
myText = myTextImport.read().replace("\n", " ") #replace line breals by space
language = "en" # fr for french
output = gTTS(text = myText, lang = language, slow = False) #slow = False for normal speech rate
output.save("output.mp3")
myTextImport.close()
os.system("start output.mp3")