Local text-to-speech synthesis using VITS/Piper models with ONNX Runtime. Run TTS locally without cloud APIs or network dependencies.
Install
| Product | Versions |
|---|---|
| .NET |
README
LMSupply.Synthesizer
Local text-to-speech synthesis using VITS/Piper models.
Known issue — the output is not yet intelligible speech. The synthesizer has no text-to-phoneme step: it maps letters to fixed ids instead of the phoneme ids the Piper voices were trained on, so what comes out is voice-like noise (a Whisper transcript of "The weather is beautiful today." read back "tube of warrior practitioner"), and text in non-Latin scripts comes out as near-silence.
Features
- Zero-config: Models download automatically from HuggingFace
- GPU Acceleration: CUDA, DirectML (Windows), CoreML (macOS)
- Licensing stated per voice: Piper's code is MIT; each voice's own license is in
SynthesizerModelInfo.License(the default voice is public domain) - Multiple Languages: English, Korean, Japanese, Chinese, and more
Quick Start
using LMSupply.Synthesizer;
#pragma warning disable LMSUPPLY001 // the output is not yet intelligible speech — see the repository README's known issue
// Load the default model
await using var synthesizer = await LocalSynthesizer.LoadAsync("default");
// Synthesize speech
var result = await synthesizer.SynthesizeAsync("Hello, welcome to LMSupply!");
Console.WriteLine($"Duration: {result.DurationSeconds:F2}s");
Console.WriteLine($"Real-time factor: {result.RealTimeFactor:F1}x");
// Save as WAV file
await synthesizer.SynthesizeToFileAsync("Hello world!", "output.wav");
Available Models
| Alias | Voice | Language | Description |
|---|---|---|---|
default |
LJSpeech | en-US | Female (public domain) |
lessac |
Lessac | en-US | High-quality female |
fast |
Ryan | en-US | Fast male voice |
quality |
Amy | en-US | High-quality female |
british |
Semaine | en-GB | British female |
korean |
KSS | ko-KR | Korean female |
chinese |
Huayan | zh-CN | Mandarin female |
GPU Acceleration
# NVIDIA GPU
dotnet add package Microsoft.ML.OnnxRuntime.Gpu
# Windows (AMD/Intel/NVIDIA)
dotnet add package Microsoft.ML.OnnxRuntime.DirectML
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.