projecteaina/tts-api

Sponsored OSS

By Barcelona Supercomputing Center

Updated almost 2 years ago

RESTful API for synthesizing speech in catalan

Image
Languages & frameworks
API management
Machine learning & AI
1

10K+

projecteaina/tts-api repository overview

Catalan Text to Speech API

Usage

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.

How to Configure the Image

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 nameDescriptionDefault valuePossible values
SPEECH_SPEEDChange the speech speed.1.0Any valid float
USE_CUDAUse CudaFalseAny 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
Rest API Endpoints
MethodEndpointDescription
POST/api/ttsGenerate speech audio from text using TTS.

Request Parameters:

ParameterTypeDescription
languagestringISO language code (e.g., "ca-es", "ca-ba", "ca-nw", "ca-va")
voicestringName of the voice to use
typestringType of input ("text" or "ssml")
textstringText to be synthesized (if type is "ssml", enclose in tags)

NOTES:

  • type ssml is not available yet.

MethodEndpointDescription
GET/api/available-voicesList of available voices ids

MethodEndpointDescription
GET/api/startup-parametersStartup parameters values (speech speed, mp_workers, etc)

Example calls

cURL
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

Tag summary

Content type

Image

Digest

sha256:f55846c88

Size

3.5 GB

Last updated

almost 2 years ago

docker pull projecteaina/tts-api

This week's pulls

Pulls:

516

Last week