An automated installation script for Piper TTS - a fast, local neural text-to-speech system. This script installs the Piper TTS binary and three high-quality voices for Dutch, English (US), and German.
Optimized for local voice generation for telephone systems - generates both standard WAV files and telephone-compatible μ-law encoded audio.
Blog: https://www.tqdev.com/2026-piper-voices-tts-telephony/
- Local, offline text-to-speech - no cloud services or API keys required
- Telephone system optimized - generates μ-law encoded audio for phone systems
- Automatically downloads and installs Piper TTS binary
- Installs 3 pre-configured voices:
- Dutch (nl_NL): alex (medium quality)
- English US (en_US): lessac (high quality)
- German (de_DE): thorsten (high quality)
- Generates test audio files in standard WAV format
- Creates μ-law encoded phone system compatible audio (8kHz, mono)
- Skips already installed components on subsequent runs
Before running the script, install the required packages:
sudo apt install wget tar soxSystem Requirements:
- Linux x86_64 architecture
- Internet connection for downloading binaries and voice models
- Sudo privileges for system-wide installation
- Clone or download this repository
- Make the script executable:
chmod +x piper-voices.sh
- Run the installation script:
./piper-voices.sh
- Location:
/opt/piper-tts/piper/piper - Version: 2023.11.14-2
- Platform: Linux x86_64
- Location:
/usr/share/piper-voices/
Each voice includes:
.onnx- The neural network model file.onnx.json- Voice configuration and metadata
After running the script, you'll find test audio files in the current directory:
nl_NL-alex-medium.wav- Dutch test audio (standard WAV)nl_NL-alex-medium_mulaw.wav- Dutch test audio (phone system format)en_US-lessac-high.wav- English test audio (standard WAV)en_US-lessac-high_mulaw.wav- English test audio (phone system format)de_DE-thorsten-high.wav- German test audio (standard WAV)de_DE-thorsten-high_mulaw.wav- German test audio (phone system format)
The μ-law encoded files are optimized for phone systems with:
- 8kHz sample rate
- Mono channel
- μ-law encoding
- 300Hz highpass and 3400Hz lowpass filters (telephone bandwidth)
After installation, you can use Piper TTS directly:
echo "Hello, this is a test." | /opt/piper-tts/piper/piper \
--model /usr/share/piper-voices/en_US-lessac-high/en_US-lessac-high.onnx \
--output_file output.wavecho "This will be spoken slower." | /opt/piper-tts/piper/piper \
--model /usr/share/piper-voices/en_US-lessac-high/en_US-lessac-high.onnx \
--output_file output.wav \
--length_scale 1.2Length scale parameter:
1.0= normal speed> 1.0= slower speech< 1.0= faster speech
- Natural-sounding Dutch voice
- Medium quality (high-quality Dutch voices not available)
- Slightly slower speech rate (1.2x) for clarity
- Professional American English voice
- High quality model
- Normal speech rate
- Clear German voice
- High quality model
- Normal speech rate
The script is idempotent - it safely skips components that are already installed. You can re-run it without concerns:
- Already installed Piper binary will be skipped
- Already downloaded voices will be skipped
- Test audio files will be regenerated
"Skipping piper TTS install" message:
- This means Piper is already installed. Delete
/opt/piper-ttsif you want to reinstall.
"Skipping [voice] (already installed)" message:
- The voice model is already present. Delete the corresponding directory in
/usr/share/piper-voices/to reinstall.
Permission denied errors:
- Ensure you have sudo privileges
- The script requires sudo for system-wide installation
Network errors:
- Check your internet connection
- Verify that GitHub and Hugging Face are accessible from your network
- Piper TTS: rhasspy/piper
- Voice Models: rhasspy/piper-voices
This installation script is provided as-is. Please refer to the Piper TTS project for licensing information about the TTS engine and voice models.