Neural TTS
Piper uses ONNX neural models for natural, human-like voice synthesis.
100% Offline
All processing is local. No API keys, no internet connection needed during use.
Ren'Py Compatible
Works transparently with Ren'Py's built-in self-voicing (press V).
Multiple Voices
US and UK English voices, plus an optional Korean voice picked automatically for lines with Hangul.
Fast
Low latency synthesis — speech starts within milliseconds of each line.
Accessibility
Makes visual novels accessible to visually impaired players on Linux.
How It Works
Ren'Py calls espeak -v <voice> -a <amp> <text> whenever self-voicing is active.
This project installs a wrapper script named espeak that intercepts those calls
and redirects speech synthesis to Piper TTS instead.
The audio is played back immediately via aplay.
Ren'Py never knows the difference — it still calls espeak, but now it sounds natural.
Installation
Install dependencies
sudo apt install alsa-utils curl git
No Python needed: this uses the standalone Piper 1.2.0 binary, which starts in about 0.25 s per line (the Python package takes about 0.95 s).
Download Piper 1.2.0
mkdir -p $HOME/.local/share $HOME/.local/bin
curl -L https://github.com/rhasspy/piper/releases/download/v1.2.0/piper_amd64.tar.gz \
| tar xz -C $HOME/.local/share
This creates ~/.local/share/piper/ with the binary, its libraries and espeak-ng-data.
Download a voice
mkdir -p $HOME/.local/share/piper/models
cd $HOME/.local/share/piper/models
V=https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_GB/jenny_dioco/medium/en_GB-jenny_dioco-medium
curl -L -O $V.onnx -O $V.onnx.json
Install the wrapper script
git clone https://github.com/zirize/piper-renpy-selfvoicing.git $HOME/.local/share/piper/scripts
ln -sf $HOME/.local/share/piper/scripts/piper_espeak_wrapper.sh $HOME/.local/bin/espeak
Or run ./install.sh from a clone of the repository to do steps 2–4 at once (./install.sh --korean adds the Korean voice).
Test
espeak "Piper installation complete."
If you hear the voice, you're done! Launch a Ren'Py game and press V to enable self-voicing.
$HOME/.local/bin is in PATH by default on Ubuntu 21.04+, Fedora, Arch, and most modern distros. If espeak is not found, run export PATH="$HOME/.local/bin:$PATH" or add it to your ~/.bashrc.
Available Voice Models
Browse all voices at rhasspy.github.io/piper-samples. Some recommended options:
| Model ID | Language | Quality |
|---|---|---|
en_US-hfc_female-medium | US English | Medium |
en_US-amy-medium | US English | Medium |
en_GB-jenny_dioco-medium | UK English | Medium (default) |
en_GB-cori-high | UK English | High |
en_GB-alba-medium | UK English (Scottish) | Medium |
en_GB-semaine-medium | UK English | Medium |
To switch voices, edit MODEL= at the top of ~/.local/share/piper/scripts/piper_espeak_wrapper.sh. Voices whose .onnx.json says "phoneme_type": "espeak" work with Piper 1.2.0.
Korean Voice
Lines containing Hangul are read with ko_KR-kss-medium (CC BY-NC-SA 4.0). Install it with ./install.sh --korean.
Its config was written by Piper 1.5.0 and makes 1.2.0 abort with Phonemes must be one codepoint;
the installer removes the five multi-codepoint entries (aɪ aʊ ɔɪ eɪ oʊ), which Korean does not use.
Auto-Advance (currently disabled)
The wrapper contains code that presses Space after each line (needs xdotool, X11 only, and RENPY_MODE=1).
It is disabled: the script exits right after playback. Delete the exit 0 line after the piper command to re-enable it.
Repository Files
| File | Description |
|---|---|
piper_espeak_wrapper.sh | The espeak wrapper; ~/.local/bin/espeak links to it |
install.sh | Installation script (--korean adds the Korean voice) |
guide.txt | Step-by-step guide |
note.txt | Quick reference for the MODEL lines |