Contenerized text-to-speech engine based on Coqui's TTS with web API
Jacek Kowalski
2024-08-01 55b8831d18635e59bb667080ebbbd8244d36d80a
commit | author | age
55b883 1 # Text-to-speech API based on Coqui's TTS
JK 2
3 Simple Python-based container with everything that is needed
4 to have a self-hosted web-based text-to-speech API.
5
6 ## Using the container
7
8 Just run:
9
10 ```
11 docker run -d -p 8000:8000 ghcr.io/jacekkow/docker-text-to-speech-api-tts:master
12 ```
13
14 and then visit http://localhost:8000/docs
15
16 There is a simple `/sythesize` endpoint that expects a JSON and returns a wave file:
17
18 ```
19 curl -o result.wav -X 'POST' \
20   'http://localhost:8000/synthesize' \
21   -H 'Content-Type: application/json' \
22   -d '{"language": "en", "text": "Sample text."}'
23 ```
24
25 ## Adding languages
26
27 Currently only English and Polish models are included in the image.
28
29 To add additional languages you can simply add extra entries
30 in `src/config.py` file and rebuild the container.
31
32 Model identifiers are defined in the TTS repository:
33 https://github.com/idiap/coqui-ai-TTS/blob/dev/TTS/.models.json
34
35 Command line `tts --list_models` lists all the available models.
36
37 Note that the API does not support multi-speaker models yet!