Use natural-sounding AI voices in Ren'Py visual novels on Linux, powered by Piper TTS.
Ren'Py's built-in self-voicing feature uses espeak to read dialogue aloud. This project replaces it with a wrapper script that silently redirects speech synthesis to Piper — a fast, local neural TTS engine — while staying fully compatible with Ren'Py's existing self-voicing system.
📖 Also available as a Reddit guide on r/RenPy
- 🔊 High-quality neural TTS voices (local, no internet required after setup)
- 🎮 Works transparently with Ren'Py's self-voicing (
Vkey) - 🔇 Filters out system messages (
Self-voicing enabled,Skipping:, etc.) - 🌍 Supports multiple English voice models (US and UK accents)
- ⏭️ Optional auto-advance: press Space automatically after each line (requires
xdotool) - 🔄 Switch voices by changing one variable in the script
- Linux (x86_64)
- Python 3.9 or later:
sudo apt install python3 aplay(ALSA/PulseAudio):sudo apt install alsa-utils- (Optional)
xdotoolfor auto-skip:sudo apt install xdotool
# 1. Install piper-tts (Python package)
pip install --user piper-tts
# 2. Create the model directory
mkdir -p $HOME/.local/share/piper/models
# 3. Download a voice model (UK English female)
python3 -m piper.download_voices en_GB-jenny_dioco-medium \
--data-dir $HOME/.local/share/piper/models
# 4. Install the espeak wrapper
mkdir -p $HOME/.local/share/piper/scripts
cp 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
# 5. Test
espeak "Piper installation complete."
$HOME/.local/binis included in PATH by default on most modern Linux distributions (Ubuntu 21.04+, Fedora, Arch, etc.). Ifespeakis not found, add it to your shell profile:export PATH="$HOME/.local/bin:$PATH"
See install.sh for the full annotated script, and guide.txt for step-by-step instructions.
- Launch your Ren'Py game
- Press
Vto enable self-voicing - Piper will now speak each line of dialogue using your selected voice model
Edit the MODEL variable at the top of $HOME/.local/share/piper/scripts/espeak:
# Available models (uncomment one):
#MODEL=en_GB-cori-high
#MODEL=en_GB-alba-medium
MODEL=en_GB-jenny_dioco-medium
#MODEL=en_GB-semaine-medium
#MODEL=en_US-hfc_female-medium
#MODEL=en_US-amy-mediumBrowse all available voices at: https://rhasspy.github.io/piper-samples/
Download additional voices with:
python3 -m piper.download_voices # list all voices
python3 -m piper.download_voices en_US-lessac-medium \
--data-dir $HOME/.local/share/piper/modelsThe wrapper can automatically press Space after each line finishes speaking, mimicking Ren'Py's auto mode while self-voicing is active.
# Install xdotool
sudo apt install xdotool
# Launch Ren'Py with auto-skip enabled
RENPY_MODE=1 ./your_game| File | Description |
|---|---|
piper_espeak_wrapper.sh |
Main espeak wrapper script (copy to ~/.local/share/piper/scripts/espeak) |
install.sh |
Automated installation script |
guide.txt |
Detailed step-by-step guide |
note.txt |
Quick reference for available voice models |
Ren'Py calls espeak -v <voice> -a <amp> <text> when self-voicing is active. This wrapper script:
- Parses the arguments (ignoring
-vand-aoptions) - Cleans up the text (removes unicode special characters Piper can't handle)
- Filters out Ren'Py system messages
- Kills any previously playing audio to prevent overlap
- Pipes the text to
piper→aplayfor immediate playback
No audio output:
- Verify
aplayworks:aplay /usr/share/sounds/alsa/Front_Left.wav - Try changing
aplay -D pulseto justaplayin the script - Check that
$HOME/.local/binis in your$PATH:echo $PATH
espeak command not found:
- Verify the symlink:
ls -la $HOME/.local/bin/espeak - Manually add to PATH:
export PATH="$HOME/.local/bin:$PATH"
Piper binary not found:
- Check:
ls $HOME/.local/share/piper/piper - Re-extract the archive if missing
This wrapper script is released into the public domain. Piper TTS is licensed under the MIT License.