jasonblum
1/2/2018 - 2:29 PM

Speech generation in Python using gTTS

Simple example of generating an mp3 file of speech with different accents.

#!/usr/bin/python3.6

from gtts import gTTS

text = 'Jó napot!  Én Huba vagyok!'

tts = gTTS(text=text, lang='ru')

tts.save("speech.mp3")