Piper TTS (VITS) for Sentis (com.sky.sentis.piper)

Unity Sentis (com.unity.ai.inference 2.6.1) runner for Piper VITS voices. Two fp32 voices ship in Model~:

Voice Language Source
en_lessac English (US) en_US-lessac-medium from rhasspy/piper-voices
ko_kss Korean Piper fine-tuned on the KSS dataset (espeak-ng Korean phonemes)

The stochastic duration predictor and flow sample noise with RandomNormalLike. It is replaced with slices of one fixed N(0,1) pool (baked, not zeroed: zeroing makes the audio buzzy), so the same input always gives the same audio.

using Piper;
using Unity.InferenceEngine;

using var tts = new PiperTts("en_lessac", backend: BackendType.CPU);   // loads StreamingAssets/Piper
tts.Warmup();
var phrases = PiperPhrases.Load(Path.Combine(PiperTts.DefaultModelDirectory, PiperTts.PhrasesFile("en_lessac")));
float[] pcm = tts.Synthesize(phrases[0].Sentences);                    // 22.05 kHz mono

Install

Add the package by git URL, then run Tools โ–ธ Piper TTS โ–ธ Install Models to StreamingAssets (or call Piper.Editor.PiperBaker.Bake()). Model~ is not included in player builds, so the files are copied to Assets/StreamingAssets/Piper.

https://huggingface.co/Sky-Kim/com.sky.sentis.piper

Text frontend (offline)

Piper ids: espeak-ng phonemes โ†’ the voice's phoneme_id_map (Model~/piper_<voice>.config.json), as BOS, PAD, (phoneme, PAD)*, EOS. There is no in-Unity G2P. Model~/phrases_<voice>.json holds precomputed ids for a test corpus, split into sentences; Tools~/build_phrases.py regenerates them (it uses the piper-tts wheel, which bundles espeak-ng).

Layout

Path What
Model~/piper_en_lessac.sentis, piper_ko_kss.sentis fp32 VITS: input[1,T] int, input_lengths[1] int, scales[3] โ†’ output[1,1,1,S]
Model~/piper_<voice>.config.json voice config (phoneme_id_map, sample rate, inference defaults)
Model~/phrases_<voice>.json precomputed ids for the benchmark corpus
Model~/fixtures/<voice>/ ONNX Runtime reference tensors used by the tests
Runtime/ PiperTts (runner), PiperPhrases
Editor/PiperBaker.cs copies Model~ into StreamingAssets
Tests/Editor/ Sentis-vs-ORT parity per voice (CPU, GPUCompute) and end-to-end synthesis
Tools~/ surgery_bake_noise.py, build_phrases.py, verify.py, asr_check.py

scales = [noise_scale 0.667, length_scale 1.0, noise_scale_w 0.8]. Per-call limits from the noise pool: en_lessac 8192 frames (95 s), ko_kss 4096 frames (~47 s); synthesize long text sentence by sentence.

Verification (Sentis 2.6.1, Unity 6000.5.5f1, Apple Silicon)

Edge en_lessac ko_kss
Original vs surgered graph (same pool slices) max|ฮ”| 0.0 (exported baked)
ORT vs Sentis CPU 1.5e-5 (SNR 102 dB) 6.1e-5 (SNR 90 dB)
ORT vs Sentis GPUCompute 1.4e-5 (SNR 102 dB) 6.4e-5 (SNR 89 dB)
Back-transcription (Whisper small) WER 8.1 % CER 25.6 %
UTMOS 3.71 2.53

Benchmark (Apple M5 Max, standalone player, warm median)

en_lessac RTF TTFA ko_kss RTF TTFA
GPUCompute 0.008 29 ms 0.007 32 ms
CPU 0.011 28 ms 0.011 36 ms

Small VITS gains little from the GPU; CPU (Burst) is a good default, especially on mobile.

License

  • en_lessac: the piper-voices repository is MIT, but the voice is trained on the Blizzard 2013 Lessac dataset, whose license restricts use. Check it before any commercial use.
  • ko_kss: trained on the KSS dataset (CC BY-NC-SA 4.0), so non-commercial.
  • Piper training code is GPL-3.0; espeak-ng (GPL-3.0) is used only offline in Tools~ and is not shipped.

The package as a whole is therefore CC BY-NC-SA 4.0. See LICENSE.md.

Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Sky-Kim/com.sky.sentis.piper

Finetuned
(5)
this model