arikSarkar

Text-to-Speech

Sep 23rd, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # Python Program - TEXT-TO-SPEECH Converter
  2. # ***INTERNET CONNECTION IS COMPULSORY
  3.  
  4. from gtts import gTTS
  5. import os
  6. from string import capwords
  7. language = 'en'
  8. filename = input("Enter your name: ")
  9. input("Hey there! "+capwords(filename)+"\nWelcome to TEXT-TO-SPEECH Converter\nPress any key to continue...")
  10. mytext = input("\nEnter text here => ")
  11.  
  12. myobj = gTTS(text=mytext, lang=language, slow=False)
  13.  
  14. myobj.save(filename+'.mp3')
Add Comment
Please, Sign In to add comment