This python script converts the given string message to audio and write it into a file. All files are stored locally on the filesystem. Before creation of the audio files, a cache mechanism checks if the audio file with the needed string message exists. If the audio file is found, there is no reason to call the tts service or create the audio file again.
Uses the Google TTS Service (online) or the pico2wave (offline) application.
- install mpg123
$ sudo apt-get install mpg123
- install Pico TTS
$ sudo apt-get install libpopt-dev; wget http://www.dr-bischoff.de/raspi/pico2wave.deb; sudo dpkg --install pico2wave.deb
- install sox to modify sound file (optional - set SOUND_MODIFY to True)
$ sudo apt-get install sox libsox-fmt-all
- install mplayer (optional)
$ sudo apt-get install mplayer
$ python tts-service.py --text "Hello"
Parameter | Description | Optional | Default |
---|---|---|---|
-t --text | text to translate | false | |
-p --provider | the tts provider (google or pico) | true | |
-d --device | the output device (e.g. bluetooh) | true | '' |
-q --quiet | do not print log messages | true | false |
-ns --noStore | do not store the soundfile | true | false |
-u --update | update soundfile if exist | true | false |
The license is committed to the repository in the project folder as LICENSE.txt
.
Please see the LICENSE.txt
file for full informations.
Markus Eschenbach
http://www.blogging-it.com