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
Choose from US and UK English voices. Switch with one line change.
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 python3 python3-pip alsa-utils
Install piper-tts
pip install --user piper-tts
Or from a locally downloaded wheel: pip install --user /path/to/piper_tts-1.4.2-*.whl
Create model directory and download a voice
mkdir -p $HOME/.local/share/piper/models
# List all available voices:
python3 -m piper.download_voices
# Download UK English (jenny_dioco):
python3 -m piper.download_voices en_GB-jenny_dioco-medium \
--data-dir $HOME/.local/share/piper/models
Install the wrapper script
# Clone this repo (or download the script manually)
git clone https://github.com/zirize/piper-renpy-selfvoicing.git
mkdir -p $HOME/.local/share/piper/scripts
cp piper-renpy-selfvoicing/piper_espeak_wrapper.sh $HOME/.local/share/piper/scripts/espeak
chmod +x $HOME/.local/share/piper/scripts/espeak
ln -sf $HOME/.local/share/piper/scripts/espeak $HOME/.local/bin/espeak
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 (default) |
en_US-amy-medium | US English | Medium |
en_GB-jenny_dioco-medium | UK English | Medium |
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/espeak.
Optional: Auto-Advance
The wrapper can automatically press Space after each dialogue line finishes speaking, so you don't have to click โ great for listening to a whole scene hands-free.
sudo apt install xdotool
RENPY_MODE=1 ./YourGame
Repository Files
| File | Description |
|---|---|
piper_espeak_wrapper.sh | Main espeak wrapper (copy to ~/.local/share/piper/scripts/espeak) |
install.sh | Automated installation script |
guide.txt | Detailed step-by-step guide |
note.txt | Quick reference for voice models |