Installation Guide
This guide will walk you through installing Piper and its dependencies, as well as downloading the necessary voice models to start synthesizing speech.
1. Installing the Python Package
Piper is available as a Python package and can be installed using pip
. Python 3.9 or higher is required.
pip install piper-tts
This command installs the core Piper engine, which includes the command-line interface and the Python API.
Optional Dependencies
Piper has optional features that require extra dependencies. You can install them as needed:
-
HTTP Server: To run the web server for network-based TTS.
pip install piper-tts[http]
-
Training: To train your own models or fine-tune existing ones.
pip install piper-tts[train]
-
Alignments: For experimental support for phoneme-audio alignment.
pip install piper-tts[alignment]
These extras can be combined. For example, to install both the HTTP server and training dependencies, run:
pip install piper-tts[http,train]
2. Downloading Voices
After installing the package, you need to download a voice model. Piper provides a built-in utility for this purpose.
First, you can list all available voices:
python3 -m piper.download_voices
This will output a list of available voice names (e.g., en_US-lessac-medium
). You can listen to voice samples here.
To download a specific voice, run the command followed by the voice name. For example, to download the US English voice "lessac-medium":
python3 -m piper.download_voices en_US-lessac-medium
This will download two files to your current directory:
en_US-lessac-medium.onnx
(the neural network model)en_US-lessac-medium.onnx.json
(the model's configuration file)
You can specify a different directory to store your voices using the --data-dir
argument:
python3 -m piper.download_voices --data-dir /path/to/your/voices en_US-lessac-medium
Next Steps
With Piper installed and a voice model downloaded, you are ready to start synthesizing speech. Check out the Quick Start guide for your first synthesis.