RESTful API for synthesizing speech in catalan
10K+
To start up projecteaina/tts-api.
docker run -p 8000:8000 projecteaina/tts-api:latest
To start up with GPU
docker run -e USE_CUDA=True --gpus all -p 8000:8000 projecteaina/tts-api:latest
NOTE: To use NVIDIA GPUs, you need to install the NVIDIA Container Toolkit. We also recommend using NVIDIA drivers with CUDA version 11.8 or higher.
Some configuration options are important when starting up this component. The following is a list of environment variables that you can set (e.g. when starting the docker image):
| Variable name | Description | Default value | Possible values |
|---|---|---|---|
| SPEECH_SPEED | Change the speech speed. | 1.0 | Any valid float |
| USE_CUDA | Use Cuda | False | Any valid boolean |
Example of launching tts-api with a speech speed of 1.2.
docker run -e SPEECH_SPEED=1.2 -p 8000:8000 projecteaina/tts-api:latest
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/tts | Generate speech audio from text using TTS. |
Request Parameters:
| Parameter | Type | Description |
|---|---|---|
| language | string | ISO language code (e.g., "ca-es", "ca-ba", "ca-nw", "ca-va") |
| voice | string | Name of the voice to use |
| type | string | Type of input ("text" or "ssml") |
| text | string | Text to be synthesized (if type is "ssml", enclose in tags) |
NOTES:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/available-voices | List of available voices ids |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/startup-parameters | Startup parameters values (speech speed, mp_workers, etc) |
curl --location --request POST 'http://localhost:8000/api/tts' --header 'Content-Type: application/json' --data-raw '{
"voice": "quim",
"type": "text",
"text": "El Consell s’ha reunit avui per darrera vegada abans de les eleccions. Divendres vinent, tant el president com els consellers ja estaran en funcions. A l’ordre del dia d’avui tampoc no hi havia l’aprovació del requisit lingüístic, és a dir la normativa que ha de regular la capacitació lingüística dels aspirants a accedir a un lloc en la Funció Pública Valenciana.",
"language": "ca-es" }' --output tts.wav
Content type
Image
Digest
sha256:f55846c88…
Size
3.5 GB
Last updated
almost 2 years ago
docker pull projecteaina/tts-apiPulls:
516
Last week