A wrapper around GameTTS application to provide its functionality as a REST API.
- Python 3.9
requirements.txt
- espeak-ng
Tested on Linux
- Create a folder
gametts
next tomain.py
- Retrieve application with models from forum.worldofplayers.de (Tested with Version 1.1.5)
- Unzip/Install the application
- Copy all contents of the application's folder into
gametts
folder - Run
pip install -r requirements.txt
- Launch server with
python main.py
(for evaluation)
Lists all possible characters to use as value for speaker_id
Lists all possible emote styles to use as value for emote_id
Lists all games from which are voices available
Lists all available voices to use as value for speaker_id
Supports the following parameters either as GET or POST request. For POST in must be supplied as JSON.
Param | Default | Mandatory | Notes |
---|---|---|---|
emotion_id |
5 | No | see adapter/extractedData.py |
speaker_id |
1 | No | Depends on data set (query with /get_voices ) |
style_id |
0 | No | see adapter/extractedData.py |
speech_speed |
1.1 | No | Lower means faster |
text |
None | Yes | Maximum length as per default is 1000 characters |
Example body:
{
"speaker_id": 147,
"text": "We're testing the text to speech system."
}
It's possible to change default settings and a few parameters via environment variables. Use full for Docker.
Variable | Default | Notes |
---|---|---|
CONF_LANGUAGE |
de | core/config.py, see espeak-ng for more languages |
CONF_SPEECH_SPEED |
1.1 | core/config.py |
CONF_SPEAKER_ID |
1 | core/config.py |
CONF_EMOTION_ID |
5 | core/config.py |
CONF_STYLE_ID |
0 | core/config.py |
CONF_MAX_TEXT_LENGTH |
1000 | core/config.py, maximum length of a text to synthesize |
CONF_MAX_FILES |
500 | core/config.py, maximum number of files to cache, 0 means infinite files |
PORT |
8000 | gunicornconfig.py |
WEB_CONCURRENCY |
1 | gunicornconfig.py, concurrent worker threads. Careful with this setting as every worker loads the speech model and needs adequate memory |