Created
October 15, 2020 09:14
-
-
Save gkfarwaha/10971016abf16c881a9c669cb2ee9772 to your computer and use it in GitHub Desktop.
input text to audio file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gtts import gTTS | |
import os | |
str = input("Please enter the text to convert it into audio file \n", ) # taking input from the user to convert it into audio file | |
txt = str | |
# txt="hello world" | |
lan = 'en' | |
output = gTTS(text=txt, lang=lan, slow=False) | |
output.save("txt2sph.mp3") | |
os.system("start txt2sph.mp3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment