Note
This project has been retired. Basic TTS is no longer running as a live service, and the code is no longer actively maintained. The repository is kept available as a reference for anyone who wants to learn from it or build their own text-to-speech system. Thank you to everyone who used it! 🎙️
This is a simple web interface for Piper Text-to-Speech that provides a user-friendly way to convert text to speech using various voice models.
This repo was almost entirely vibe-coded in Cursor.
- Python 3.8 or higher
- espeak-ng (required for Piper)
- Git LFS (for managing voice model files)
- Voice models in ONNX + JSON format
-
Install system dependencies:
For macOS:
# Install espeak-ng, git-lfs and build dependencies brew install espeak-ng cmake ninja git-lfs # Initialize Git LFS git lfs install # Install Piper (much simpler now!) pip install piper-tts
For Linux:
# Install espeak-ng and git-lfs sudo apt-get update sudo apt-get install espeak-ng git-lfs # Initialize Git LFS git lfs install # Install Piper (much simpler now!) pip install piper-tts
For Windows:
# Install Git LFS using the installer from https://git-lfs.com # Or using Chocolatey: choco install git-lfs # Initialize Git LFS git lfs install # Install Piper pip install piper-tts
-
Install the web interface package:
pip install -e . -
Download voice files from Piper Samples (you can listen to samples and download the ones you like)
- Place the downloaded .onnx files and their corresponding .json files in the
modelsdirectory
- Place the downloaded .onnx files and their corresponding .json files in the
The application is deployed to the cloud using disco.cloud with automatic Docker containerization.
-
Configure
disco.jsonfor the service:{ "version": "1.0", "services": { "web": { "port": 8000 } } } -
Set environment variables via the dashboard.disco.cloud UI:
FIREBASE_API_KEYFIREBASE_AUTH_DOMAINFIREBASE_PROJECT_IDFIREBASE_STORAGE_BUCKETFIREBASE_MESSAGING_SENDER_IDFIREBASE_APP_IDFIREBASE_MEASUREMENT_IDFIREBASE_SERVICE_ACCOUNT_JSONREVENUECAT_API_KEY
-
Deploy using disco:
disco deploy
For local Docker deployment:
-
Build the Docker image:
docker build -t piper-tts-web . -
Run the container:
docker run -p 8000:8000 -v $(pwd)/models:/app/models piper-tts-web
The application is deployed at BasicTTS.com
-
Start the development server:
python -m piper_tts_web.server
The server will start on
http://localhost:8000 -
Open your web browser and navigate to
http://localhost:8000 -
Select a voice from the dropdown menu
-
Enter the text you want to convert to speech
-
Click "Convert to Speech" and wait for the audio to be generated
-
Use the audio player to:
- Play/pause the generated audio
- Adjust the playback speed
- Download the audio file
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On macOS/Linux
-
Install development dependencies:
pip install -e ".[dev]" -
Run tests:
pytest
-
Format code:
black .
-
If you get a "piper command not found" error:
- Make sure espeak-ng is installed
- Verify that Piper is installed correctly
- Check that the package is in your Python path
- Try running
which piperto verify the installation - Make sure your PATH includes the directory where piper is installed
-
If no voices appear in the dropdown:
- Check that you have .onnx files in the
modelsdirectory - Make sure each .onnx file has a corresponding .json file
- Verify that the files are properly named (e.g.,
en_US-amy-medium.onnx)
- Check that you have .onnx files in the
-
If the conversion fails:
- Check the server logs for detailed error messages
- Verify that the selected voice model exists
- Make sure the text input is not empty
- The server expects voice model files to be in ONNX format
- Temporary audio files are automatically cleaned up after processing
- The web interface supports various playback speeds (0.25x to 2x)
- Processing can be done locally or in the cloud
- Docker deployment provides consistent environments
- Cloud deployment via disco.cloud for production
- Firebase authentication integrated for user management
- RevenueCat integration for subscription management