Piper
5 min read

Piper is a fast, local neural text-to-speech (TTS) engine. It is designed for offline, low-latency speech synthesis on desktops, embedded devices, Raspberry Pi-class hardware, and home automation systems.

Current state

The original rhasspy/piper repository is archived and read-only. Development moved to the Open Home Foundation fork:

• old archived repo: https://github.com/rhasspy/piper
• current repo: https://github.com/OHF-Voice/piper1-gpl

So Piper is not “dead,” but the old repo is obsolete. The maintained line is OHF-Voice/piper1-gpl, published as piper-tts.

Also note the tradeoff: Piper is still useful for lightweight offline TTS, but it is not the most advanced neural voice generation system. For naturalness, voice cloning, emotional speech, or multilingual zero-shot voices, newer systems may sound better but usually need more compute and have more complicated licensing/serving concerns.

When to use Piper

Use Piper when you want:

• fast offline TTS;
• simple command-line synthesis;
• low-latency Home Assistant voice output;
• predictable local voices;
• a small TTS sidecar for an AI assistant;
• Raspberry Pi / edge-device speech output.

Use a newer/heavier TTS stack when you need:

• voice cloning;
• expressive/emotional speech;
• very natural long-form narration;
• multi-speaker conversational synthesis;
• commercial-grade studio quality.

Install

sh
pip install piper-tts

For the HTTP server extras:

sh
pip install 'piper-tts[http]'

Voices

List available voices:

sh
python3 -m piper.download_voices

Download a voice:

sh
python3 -m piper.download_voices en_US-lessac-medium

Voices are ONNX models plus JSON configs:

• en_US-lessac-medium.onnx
• en_US-lessac-medium.onnx.json

Voice quality levels are commonly named:

• x_low
• low
• medium
• high

Always check each voice’s MODEL_CARD/license. Piper code and Piper voice models are not the same licensing question.

CLI usage

sh
# Write to a WAV file
python3 -m piper -m en_US-lessac-medium -f out.wav -- 'Hello world'

# Play immediately if ffplay is installed
python3 -m piper -m en_US-lessac-medium -- 'This will play on your speakers.'

# Use a custom voice directory
python3 -m piper --data-dir ./voices -m en_US-lessac-medium -f out.wav -- 'Hello from Piper'

Useful options:

• --cuda — enable GPU acceleration if onnxruntime-gpu is installed.
• --input-file — read text from one or more files.
• --sentence-silence — add silence between sentences.
• --volume — adjust output volume.
• --no-normalize — disable automatic volume normalization.
• --output-raw — stream raw audio bytes.

The CLI reloads the model each run, so for repeated use prefer the HTTP server.

HTTP server

sh
python3 -m piper.http_server -m en_US-lessac-medium

This starts a server on port 5000 by default.

Open:

text
http://localhost:5000

Inspect voice/server info:

sh
curl localhost:5000/info
curl localhost:5000/voices

Synthesize audio:

sh
curl -X POST \
-H 'Content-Type: application/json' \
-d '{ "text": "This is a test." }' \
-o test.wav \
localhost:5000/synthesize

Request fields include:

• text — required text to synthesize.
• voice — optional voice name; defaults to server -m voice.
• speaker / speaker_id — for multi-speaker voices.
• length_scale — speaking speed.
• noise_scale — speech variability.
• noise_w_scale — phoneme width variability.

Python API

python
import wave
from piper import PiperVoice

voice = PiperVoice
.load("/path/to/en_US-lessac-medium.onnx")

with wave.open("output.wav", "wb") as wav_file:
voice.synthesize_wav("Hello from Piper!", wav_file)

CUDA:

python
voice = PiperVoice.load("/path/to/voice.onnx", use_cuda=True)

Streaming:

python
for chunk in voice.synthesize("Hello from streaming Piper"):
# chunk.sample_rate, chunk.sample_width, chunk.sample_channels
# chunk.audio_int16_bytes
write_raw_audio(chunk.audio_int16_bytes)

Home Assistant / Wyoming protocol

Piper is commonly used through Home Assistant’s Wyoming protocol.

yaml
services:
piper:
image: rhasspy/wyoming-piper
command: --voice en_US-lessac-medium
volumes:
-
piper_data:/data
ports:
- 10200:10200

Open Home Foundation also maintains voice-assistant-related projects such as wyoming-piper, wyoming-faster-whisper, and micro-wake-word.

AI assistant wiring

Piper is usually the TTS end of a local voice assistant:

flowchart TD
    Mic[Microphone]
    STT[Speech-to-text: whisper.cpp or faster-whisper]
    LLM[LLM/tool model through LiteLLM]
    TTS[Piper HTTP server]
    Speaker[Speaker]

    Mic --> STT --> LLM --> TTS --> Speaker

With LiteLLM, use Piper as a sidecar rather than trying to force it into the LLM gateway. LiteLLM routes model calls; Piper turns final text into audio.

Alternatives / newer TTS options

See also: Chatterbox for a stronger self-hosted TTS option when you want natural speech, voice cloning, multilingual generation, and voice-agent-friendly latency.

Piper remains good for lightweight offline TTS, but newer options may be better depending on goals:

Tool/model familyBest forTradeoff
Piper / piper1-gplFast local deterministic voices, Home Assistant, edge devicesLess expressive/natural than newer large TTS systems.
ChatterboxAdvanced self-hosted voice cloning, multilingual TTS, and low-latency English agent speechHeavier than Piper; GPU recommended.
CosyVoiceProduction multilingual/cross-lingual streaming TTSMore complex deployment stack.
IndexTTS2Emotion/style control and duration-control research directionNewer stack; check exact feature availability by release.
DiaRealistic two-speaker dialogue generationEnglish-focused and GPU-oriented.
Kokoro-style lightweight TTSSmall modern neural TTS with good quality for sizeEcosystem and licensing vary by implementation/model.
Coqui/XTTS-style systemsVoice cloning and multilingual expressive speechHeavier; licensing and project maintenance need checking.
StyleTTS2 / research TTSHigh-quality expressive generation experimentsMore research-oriented; not as simple to deploy.
ElevenLabs / hosted TTSVery natural hosted voicesExternal service, cost, privacy, and license constraints.
OpenAI/Azure/Google TTSHosted production APIsCloud dependency and provider pricing/policies.

Caveats

• The maintained Piper repo is GPL-3.0; check whether that matters for your distribution model.
• Voice models have their own licenses.
• The CLI is convenient but slow for repeated calls because it loads the model each time.
• Piper is excellent for simple offline TTS, but not necessarily state of the art for voice quality.