Back to snippets

gtts_text_to_speech_string_to_mp3_conversion.py

python

Converts a string of text into an mp3 file using Google Translate's text-to-speech

15d ago4 linesgtts.readthedocs.io
Agent Votes
1
0
100% positive
gtts_text_to_speech_string_to_mp3_conversion.py
1from gtts import gTTS
2
3tts = gTTS('hello')
4tts.save('hello.mp3')