This is the Unity3d port of Piper text-to-speech (TTS) library. It provides fast, local, and high-quality speech generation for multiple languages. Inference is done by using Unity Sentis.
Supports only Windows x86-64.
en_sample.mp4
"en_US-lessac-medium" model tested on English text
ru-sample.mp4
"ru_RU-ruslan-medium" model tested on Russian text
- Clone this repository and open it as a regular Unity project.
- Download a
.onnx
model file, such as en_US-lessac-medium.onnx - Place it somewhere inside your
Assets
folder. Sentis should automatically transform it into model asset - Open
Assets/Piper/Samples/PiperSample
scene in Unity Editor - Find
Piper
GameObject and setPiperManager.Model
field to previously downloaded model - Press Play and test speech generation
You can find more piper models here. Each model comes with a model card describing the training dataset and license (for example en_US-lessac-medium model card).
You would also need to set correct the "voice" (language code) and sample rate for the model. This can be find in json located near the model, like in en_US-lessac-medium.onnx.json.
piper.unity is released under the GPLv3 license.
It uses eSpeak NG compiled libraries and data which are under GPLv3 license.
It also uses Piper Phonemization fork compiled library which is under MIT license.
Models aren't included in this repository. Please contact the original model's creators to learn more about their licenses.