furas

gTTS - Linux - Google Text-To-Speech API

Jul 19th, 2018
37
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #
  2. # pip install gtts
  3. #
  4.  
  5. from gtts import gTTS
  6. import os
  7.  
  8. tts = gTTS(text='Good Day, what a nice day today.', lang='en')
  9. tts.save("voice.mp3")
  10. os.system("xplayer voice.mp3")
  11.  
  12. tts = gTTS(text='Witaj. Ładna dzisiaj pogoda.', lang='pl')
  13. tts.save("voice.mp3")
  14. os.system("xplayer voice.mp3")
  15.  
  16. tts = gTTS(text='Доброе утро, сегодня хороший день.', lang='ru')
  17. tts.save("voice.mp3")
  18. os.system("xplayer voice.mp3")
RAW Paste Data