A FastAPI server that provides a REST API for text-to-speech synthesis using the Piper TTS engine.
- Text-to-speech synthesis via REST API
- Support for multiple voices
- Docker containerization for easy deployment
- Docker Hub integration for image distribution
- Docker
- Docker Compose (optional, for using docker-compose.yml)
-
Create a
.env
file with your Docker Hub username:DOCKER_USERNAME=yourusername
-
Run the container:
run.bat
Or use the direct Docker command:
run_direct.bat
-
Build the Docker image:
build.bat
-
Run the container:
run.bat
POST /tts
: Convert text to speechGET /voices
: List available voicesGET /health
: Health check endpoint
This project includes scripts to help you manage the Docker image on Docker Hub:
- build.bat: Builds the Docker image locally
- publish.bat: Builds and pushes the image to Docker Hub
- run.bat: Runs the container using docker-compose
- run_direct.bat: Runs the container using direct Docker commands
- Make sure you have a Docker Hub account
- Create a
.env
file with your Docker Hub username - Run
publish.bat
to build and push the image to Docker Hub
Once published, you can run the container directly from Docker Hub:
- Make sure your
.env
file contains your Docker Hub username - Run
run.bat
orrun_direct.bat
The server can be configured using environment variables:
TZ
: Timezone (default: UTC)
api.py
: FastAPI server implementationDockerfile
: Docker container definitiondocker-compose.yml
: Docker Compose configurationvoices/
: Directory containing voice models.env
: Configuration file for Docker Hub usernamebuild.bat
: Script to build the Docker image locallypublish.bat
: Script to publish the image to Docker Hubrun.bat
: Script to run the container using docker-composerun_direct.bat
: Script to run the container directly
[Include license information here]