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.

Metadata

Release files for solystopia-piper-tts 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solystopia-piper-tts 0.1.0
File Size Uploaded Provenance Actions
solystopia_piper_tts-0.1.0.tar.gz 18.2 kB Without provenance Details for solystopia_piper_tts-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solystopia-piper-tts 0.1.0
File Interpreter ABI Platform Actions
solystopia_piper_tts-0.1.0-py3-none-any.whl Python 3 none any Details for solystopia_piper_tts-0.1.0-py3-none-any.whl

Total release size: 37.0 kB

Release files / solystopia_piper_tts-0.1.0.tar.gz

Download URL solystopia_piper_tts-0.1.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
994104eae493c2c2ffa593e3f1f7d6b9219cd3892d8cc0d70c2cf4e9a38d878e
BLAKE2b-256 checksum
How to use checksums
f3429f075691e24ecdfccc252c04648075071e421a848f49c6dac6a4cac3b84c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / solystopia_piper_tts-0.1.0-py3-none-any.whl

Download URL solystopia_piper_tts-0.1.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9f487356ead32c5c8543b72ac45cce76e26ff0ece64a39616623165f13a9837
BLAKE2b-256 checksum
How to use checksums
ef3b79522c76027f1ecbe5f61a6f45016b70aa7ca9d0f95bebca2c326c384e55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for solystopia-piper-tts 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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