Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gtts import gTTS
- language = input('ru/en/de/fr: ') # russian, english (original), deutsch, french
- def text_to_speech(text, file_name):
- tts = gTTS(text=text, lang=language)
- tts.save(file_name)
- text = input('Write text to speach: ')
- file_name = "output.mp3"
- text_to_speech(text, file_name)
- # sample of convert text to speach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement