Advertisement
skip420

basic_Text2Speech

Aug 12th, 2021 (edited)
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. import gtts
  2. from playsound import playsound
  3.  
  4. tts = gtts.gTTS('who are you?', lang='en')
  5.  
  6. # save the audio file
  7. tts.save("hello.mp3")
  8. # play the audio file
  9. playsound("hello.mp3")
  10. # all available languages along with their IETF tag
  11. print(gtts.lang.tts_langs())
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement