mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
1d2de84900
* New commit * Added example file (run.py) * New commit * Added 'TTS - Text to Speech Mp3' |
||
---|---|---|
.. | ||
README.md | ||
requirements.txt | ||
run.py |
TTS - Text to Speech Mp3
Write spoken mp3 data to a file, a file-like object (bytestring) for further audio manipulation, or stdout. This example uses the Python library gTTS (Google Text-to-Speech), to interface with Google Translate's text-to-speech API.
Installation
$ pip install requirements.txt
Quickstart
>>> from gtts import gTTS
>>> tts = gTTS('hello')
>>> tts.save('hello.mp3')
Disclaimer
gTTS project is not affiliated with Google or Google Cloud. Breaking upstream changes can occur without notice. This project is leveraging the undocumented Google Translate speech functionality and is different from Google Cloud Text-to-Speech.