A Fast, Local Neural Text-to-Speech System: Piper in Unity for Multi-Platform
Piper is a lightweight, on-device text-to-speech system designed for real-time performance, which is one of the Open Home Foundation Projects. The neural models are optimized for fast inference while maintaining high-quality speech synthesis. By using pre-trained voices, you can easily switch between different voice nationalities through Piper Voices.
This repository provides Unity integration for Piper, enabling cross-platform text-to-speech capabilities with real-time performance on Windows, macOS, and Android mobile devices.
- ✅ Multi-platform support: Windows, macOS, and Android
- ✅ 100+ languages and accents: Powered by espeak-ng phoneme generation
- ✅ On-device processing: No internet connection required
- ✅ Lightweight models: Compact voice models (20~60MB) for efficient deployment
- ✅ Pre-built libraries: Ready-to-use binaries included
- ✅ Extensive voice collection: Access to various pre-trained voice models
- Unity:
6000.0.50f1 - Inference Engine:
2.2.1 - espeak-ng:
1.5.2
This repository includes a Unity port of espeak-ng for multilingual phoneme generation. The library supports more than 100 languages and accents.
Pre-built libraries included:
- Windows:
.dll - macOS:
.dylib - Android:
.so
The system uses pre-trained neural voice models that can be easily downloaded and integrated into your Unity project.
- Clone or download this repository
- Unzip the provided StreamingAssets.zip file and place its contents into the
/Assets/StreamingAssetsdirectory in your project
- Open the
/Assets/Scenes/PiperScene.unityscene in the Unity Editor - Run the scene to see the piper tts tests in action
To find and download additional pre-trained voices:
- Browse available voices: Piper Voice Samples
- Check the complete voice list: VOICES.md
- Import the
.onnxand.jsonfiles into your Unity project's Assets folder (A few voice models are not compatible with the current version of the Inference Engine and cannot be imported.)
Want to train your own voice model? Follow the official training guide: TRAINING.md
| Platform | Status | Library Format |
|---|---|---|
| Windows | ✅ | .dll |
| macOS | ✅ | .dylib |
| Android | ✅ | .so |
- If not executable on Windows, install espeak-ng.msi manually.
- Follow the Project Setup steps in the Getting Started section
- Import the appropriate platform libraries
- Configure the TTS system in your Unity scenes
Experience piper-unity in action! Check out our demo showcasing:
This project follows the licensing terms of its underlying components. Please refer to the original Piper and espeak-ng repositories for detailed license information.
