Skip to content

Repository files navigation

Piper Voices TTS Installer

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/

Features

  • 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

Prerequisites

Before running the script, install the required packages:

sudo apt install wget tar sox

System Requirements:

  • Linux x86_64 architecture
  • Internet connection for downloading binaries and voice models
  • Sudo privileges for system-wide installation

Installation

  1. Clone or download this repository
  2. Make the script executable:
    chmod +x piper-voices.sh
  3. Run the installation script:
    ./piper-voices.sh

What Gets Installed

Piper TTS Binary

  • Location: /opt/piper-tts/piper/piper
  • Version: 2023.11.14-2
  • Platform: Linux x86_64

Voice Models

  • Location: /usr/share/piper-voices/

Each voice includes:

  • .onnx - The neural network model file
  • .onnx.json - Voice configuration and metadata

Output Files

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)

Usage Examples

After installation, you can use Piper TTS directly:

Basic text-to-speech:

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.wav

With speech rate adjustment:

echo "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.2

Length scale parameter:

  • 1.0 = normal speed
  • > 1.0 = slower speech
  • < 1.0 = faster speech

About the Voices

Dutch (nl_NL-alex-medium)

  • Natural-sounding Dutch voice
  • Medium quality (high-quality Dutch voices not available)
  • Slightly slower speech rate (1.2x) for clarity

English US (en_US-lessac-high)

  • Professional American English voice
  • High quality model
  • Normal speech rate

German (de_DE-thorsten-high)

  • Clear German voice
  • High quality model
  • Normal speech rate

Re-running the Script

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

Troubleshooting

"Skipping piper TTS install" message:

  • This means Piper is already installed. Delete /opt/piper-tts if 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

Credits

License

This installation script is provided as-is. Please refer to the Piper TTS project for licensing information about the TTS engine and voice models.

About

An automated installation script for Piper TTS: a fast, local neural text-to-speech system

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages