New Tool Radar

Local AI

Generate Speech Locally with Piper Text-to-Speech

Install Piper TTS, download the en_US-lessac-medium voice, and synthesize a first WAV file entirely on CPU.

Schematic with three steps: Install Piper in a virtual environment; Download a voice; Synthesize a test phrase.

Piper is a free neural text-to-speech engine that turns written text into spoken audio entirely on the machine it runs on, using compact voice models and no GPU. A medium-quality voice is one 63 MB file plus a small config, and it renders audio at 22,050 Hz.

What you need

  • Python 3.9 or newer with pip
  • About 1 GB of free disk space for the engine and a couple of voices
  • Internet access for the install and the one-time voice download

Step 1: Install Piper in a virtual environment

Run python3 -m venv ~/piper and activate it, then run pip install piper-tts. Most current distributions refuse a global pip install, so a virtual environment is the standard way around that. Check the install with python3 -m piper –help.

Step 2: Download a voice

Run python3 -m piper.download_voices en_US-lessac-medium. Every voice is two files, a .onnx model and a matching .onnx.json config, and the engine will not start without both. Run the downloader with no argument to list the available voices.

Step 3: Synthesize a test phrase

Run python3 -m piper -m en_US-lessac-medium -f test.wav — ‘This is a test.’. The command writes test.wav and confirms the model loads and the phonemizer works. Play the file to hear the voice, and check its sample rate and length afterwards.

Worked example: first synthesis with lessac-medium

The table below is a synthetic example. The commands, the voice name, and the 63 MB size come from the cited Piper guides; the sentence is their documented test phrase.

Step Command or file Expected result
Install pip install piper-tts Package installs
Voice python3 -m piper.download_voices en_US-lessac-medium Two files, about 63 MB
Speak python3 -m piper -m en_US-lessac-medium -f test.wav test.wav at 22,050 Hz

Expected result (UNTESTED). test.wav is created, plays back the sentence This is a test, and the voice files are present as an .onnx and .onnx.json pair. This check was not run live; the commands come from the cited Piper guides.

Limits

  • Piper runs entirely on CPU; no GPU is involved or needed.
  • The original rhasspy/piper repository is archived; development moved to OHF-Voice/piper1-gpl.
  • Each voice carries its own license; check the model card before commercial use.
  • The HTTP server on port 5000 has no login; bind it to 127.0.0.1 or put a proxy in front.

Sources

See all