Install Piper TTS on Debian (Offline Neural Text-to-Speech)
Piper is an open-source, offline neural text-to-speech (TTS) engine developed by Rhasspy. It allows you to generate speech locally without relying on cloud services, making it perfect for privacy-conscious applications or offline systems.
In this guide, we’ll show you how to install Piper on Debian Linux, download an English voice model, and generate a test speech audio.
Step 1: Install dependencies
Before installing Piper, make sure your system has the required packages:
sudo apt update
sudo apt install -y wget tar curl python3 python3-pip ffmpeg
ffmpegis optional but useful to play or convert generated audio files.
Step 2: Download and install Piper
Download the Piper binary and place it in your system PATH:
cd /opt
sudo wget https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_amd64.tar.gz
sudo tar -xzf piper_amd64.tar.gz
cd piper/
# Move the Piper binary itself to /usr/local/bin
sudo mv piper /usr/local/bin/
# also need to move piper all file on /usr/loca/bin/
mv * /usr/local/bin/
sudo chmod +x /usr/local/bin/piper
Test the installation:
piper --version
Expected output:
1.2.0
Step 3: Download a voice model
Create a directory to store Piper voice models:
sudo mkdir -p /opt/piper-voices
cd /opt/piper-voices
Download an English female voice model (Lessac Medium):
sudo wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx
sudo wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json
Ensure both
.onnxand.jsonfiles are in the same folder.
Step 4: Generate a test audio
Create a sample speech audio:
echo "Hello, this is a test of Piper TTS on Debian" | \
piper --model /opt/piper-voices/en_US-lessac-medium.onnx --output_file /tmp/test.wav