Added "TTS - Text to Speech Mp3" (#248)

* New commit

* Added example file (run.py)

* New commit

* Added 'TTS - Text to Speech Mp3'
This commit is contained in:
Antonio Andrade 2022-02-08 10:26:52 +04:00 committed by GitHub
parent bba0512e1c
commit 1d2de84900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View File

@ -63,6 +63,7 @@ So far, the following projects have been integrated to this repo:
|[SMS your location](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SmsYourLocation)|[prince]()|
|[Squid installer for Ubuntu](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Squid-Proxy-Installer-for-Ubuntu16)|[Berkay Demir]()|
|[Subtitle downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Subtitle-downloader)|[Kaushlendra Pratap](https://github.com/kaushl1998)|
|[TTS - Text to Speech Mp3](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TTS_Text_to_Speech_Mp3)|[Antonio Andrade](https://github.com/xAndrade)|
|[Top_News](Top_News)|[Attupatil](https://github.com/Attupatil)|
|[Take Screenshot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Take_screenshot)|[Moad Mohammed Elhebri](https://github.com/moadmmh)|
|[To Do Bot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/To-Do-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)|

View File

@ -0,0 +1,20 @@
# 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](https://pypi.org/project/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](https://pypi.org/project/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.

View File

@ -0,0 +1 @@
gTTS

View File

@ -0,0 +1,8 @@
from gtts import gTTS
def main():
tts = gTTS('hello')
tts.save('hello.mp3')
if __name__ == "__main__":
main()