Skip to main content

piper-local-tts-demo

Local text-to-speech. Your machine, your voice, no cloud required.

Run Piper — a fast, offline TTS engine — on your own hardware. Speak any text aloud without sending a single byte to the internet.

license: MIT python 3.9+


Why this matters

Most text-to-speech today routes through cloud APIs — every word goes to Google, Amazon, or Microsoft. Piper flips this:

  • Runs entirely on your machine — laptop, desktop, Raspberry Pi
  • Works offline — no internet after setup
  • No ongoing costs — nothing per word, per month, ever
  • Private by default — your text stays on your hardware

This is the difference between renting a voice and owning one.


Quick start

No repo to clone — install straight from GitHub:

pip install git+https://github.com/arthursilas-ai/piper-local-tts-demo.git
curl -sO https://raw.githubusercontent.com/arthursilas-ai/piper-local-tts-demo/main/download_voice.sh && bash download_voice.sh
piper-speak "The future belongs to those who own their tools."

Installs five commands: piper-speak, piper-server, piper-announce, piper-batch, piper-voices.

Or as an agent skill: npx skills add arthursilas-ai/piper-local-tts-demo

Working from a clone instead:

# 1. Install Piper
pip install piper-tts

# 2. Download a voice (~60MB, one time)
./download_voice.sh

# 3. Speak something
python speak.py "The future belongs to those who own their tools."

That is the whole thing. No account, no key, no internet after step 2.


What is in this repo

File What it does
speak.py Speak any text from the command line or stdin
home_announcer.py Practical home announcement system with templates
batch.py Speak or export a text file line by line
server.py Local HTTP server — curl to speak, works with Home Assistant / Node-RED
list_voices.py Browse and download Piper voices by language
download_voice.sh Download the default British English voice

speak.py — basic usage

# Say something
python speak.py "Dinner is ready."

# Save to a WAV file instead of playing
python speak.py --output announcement.wav "Meeting in five minutes."

# Read from stdin (pipe-friendly)
echo "Task complete." | python speak.py

# Use a different voice
python speak.py --voice voices/en_US-lessac-medium.onnx "Hello from the US."

server.py — HTTP endpoint for home automation

Run a local HTTP server so any script, smart home system, or browser tab can trigger speech:

python server.py              # starts on port 5000
python server.py --port 8080  # different port

Then from anywhere on the same machine (or your local network):

# Speak something
curl "http://localhost:5000/speak?text=Dinner+is+ready"

# POST with JSON
curl -X POST http://localhost:5000/speak \
  -H "Content-Type: application/json" \
  -d '{"text": "Motion detected in the kitchen."}'

# Built-in templates
curl http://localhost:5000/template/time     # "The time is 3:45 PM."
curl http://localhost:5000/template/washing  # "The washing machine has finished."
curl http://localhost:5000/template/morning  # "Good morning. Today is Saturday..."

# Download the WAV instead of playing (useful for remote clients)
curl "http://localhost:5000/speak?text=Hello&download=1" -o hello.wav

# Health check
curl http://localhost:5000/health

Browser UI: open http://localhost:5000 for a simple web interface.

Home Assistant integration

# configuration.yaml
shell_command:
  announce: 'curl -s "http://localhost:5000/speak?text={{ message }}"'

# Then in an automation:
service: shell_command.announce
data:
  message: "Front door opened."

Node-RED integration

Use the HTTP Request node: POST http://localhost:5000/speak with JSON body {"text": "{{ msg.payload }}"}.


home_announcer.py — smart home announcer

A class-based announcer with templates, urgent repeat, and a real attention chime:

python home_announcer.py "Washing machine finished"
python home_announcer.py --urgent "Front door opened"   # says it twice
python home_announcer.py --chime "Package delivered"    # beep then speak
python home_announcer.py --time                         # "The time is 3:45 PM."
python home_announcer.py --template washing
python home_announcer.py --list-templates               # show all templates

Available templates: time, reminder, timer, door, washing, weather.


batch.py — process a text file

Speak or export multiple lines in sequence:

# Speak every line in a file
python batch.py announcements.txt

# Export as numbered WAV files
python batch.py announcements.txt --export wav_output/

# Named exports: prefix each line with "name: "
echo "morning: Good morning, it is eight o clock." >> named.txt
echo "wash: The washing machine has finished."     >> named.txt
python batch.py named.txt --export wav_output/
# produces: wav_output/morning.wav, wav_output/wash.wav

# Pipe from stdin
cat script.txt | python batch.py

# Built-in demo
python batch.py --demo

list_voices.py — browse available voices

Piper has voices in 30+ languages:

python list_voices.py                              # all English voices
python list_voices.py --lang en_GB                 # British English only
python list_voices.py --lang de                    # German
python list_voices.py --lang all                   # every language
python list_voices.py --download en_US-ryan-medium # print download command

Recommended voices:

Voice key Description
en_GB-alan-medium British English, male, general purpose
en_GB-alba-medium British English, female, clear
en_US-lessac-medium American English, female, neutral
en_US-ryan-medium American English, male, natural
de_DE-thorsten-medium German, male, clear
fr_FR-siwis-medium French, female, natural

Full list and audio samples: https://rhasspy.github.io/piper-samples/


Hardware performance

Device Short phrase Notes
MacBook Pro M1 < 50ms Near-instant
ThinkPad T480 (i5) ~80ms Fast enough
Raspberry Pi 4 (4GB) ~200ms Good for announcements
Raspberry Pi 3 ~500ms Noticeable delay, still works

Disk: ~50–100MB per voice. RAM: ~200MB during inference.


What this connects to

Piper is one piece of a stack that runs entirely on your own hardware:

  • Whisper (speech-to-text) + Piper (text-to-speech) = local voice interface
  • Add a local LLM (Llama, Mistral, Phi) = voice assistant with no cloud at all
  • No subscriptions, no one listening, no vendor lock-in

Learn more


A Solystopia tool showcase — AI tools that run on hardware you own.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solystopia_piper_tts-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solystopia_piper_tts-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file solystopia_piper_tts-0.1.0.tar.gz.

File metadata

  • Download URL: solystopia_piper_tts-0.1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for solystopia_piper_tts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 994104eae493c2c2ffa593e3f1f7d6b9219cd3892d8cc0d70c2cf4e9a38d878e
MD5 b9eb1a5f8bb857f4523d157dd297d1a1
BLAKE2b-256 f3429f075691e24ecdfccc252c04648075071e421a848f49c6dac6a4cac3b84c

See more details on using hashes here.

File details

Details for the file solystopia_piper_tts-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for solystopia_piper_tts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f487356ead32c5c8543b72ac45cce76e26ff0ece64a39616623165f13a9837
MD5 050348512c4cda7e94177016aaa93c33
BLAKE2b-256 ef3b79522c76027f1ecbe5f61a6f45016b70aa7ca9d0f95bebca2c326c384e55

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page