File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # Ignore all req folders inside the projects
2+ * /req
3+
4+ # Text-To-Speech
5+ text-to-speech /speech.mp3
Original file line number Diff line number Diff line change 1+ # Text-To-Speech
2+
3+ This code uses the gtts library to read a textinput and create an mp3 file. Very simple but very cool.
4+
5+ Create a virtualenv using python3 and install the requirements with:
6+
7+ ```
8+ virtualenv -p python3 req
9+ source req/bin/activate
10+ pip install -r requirements.txt
11+ ```
12+
13+ To run the app just do:
14+ ```
15+ python tts.py
16+ ```
17+
18+ For the first version the text is just hard coded inside the file but next step is to make the app take an optional input like:
19+
20+ ```
21+ python tts.py -t "Some random text that we want in an mp3 file"
22+ ```
Original file line number Diff line number Diff line change 1+ beautifulsoup4 == 4.6.0
2+ bs4 == 0.0.1
3+ certifi == 2018.4.16
4+ chardet == 3.0.4
5+ click == 6.7
6+ gTTS == 2.0.0
7+ gTTS-token == 1.1.1
8+ idna == 2.6
9+ requests == 2.18.4
10+ six == 1.11.0
11+ urllib3 == 1.22
Original file line number Diff line number Diff line change 1+ from gtts import gTTS
2+
3+ text = ("Hello world!" )
4+ tts = gTTS (text = text , lang = 'en' )
5+ tts .save ("speech.mp3" )
You can’t perform that action at this time.
0 commit comments