First of its kind · Pure .NET

Run F5-TTS in .NET.
No Python.

The first library to run F5-TTS voice cloning entirely on ONNX Runtime. Feed a reference clip and text, get 24 kHz audio back.

$dotnet add package Horus.F5Tts.Onnx
MIT licensed .NET 8+ ONNX Runtime CPU · DirectML · CUDA No Python

Why

Native speech synthesis, minus the sidecar.

Everything heavy — STFT, the diffusion transformer, the vocoder — lives inside the ONNX graphs. The library just marshals tensors.

No Python, no PyTorch

Ship a native app with a single dependency — ONNX Runtime. No embedded interpreter, no pip, no server process.

Your GPU, your choice

The library never forces an execution provider. Pick CPU, DirectML (any DX12 GPU) or CUDA with a one-line session hook.

Tiny surface

Load the model, call Synthesize, get 24 kHz audio. Character-level tokenizer and WAV helpers included.

Quick start

Three lines to a voice.

Add the package and a runtime (Microsoft.ML.OnnxRuntime for CPU, .DirectML for a GPU), then:

using Horus.F5Tts.Onnx;

// Load once (heavy). Add a GPU provider via the optional hook.
using var model = F5TtsModel.Load(
    "F5_Preprocess.onnx", "F5_Transformer.onnx",
    "F5_Decode.onnx", "vocab.txt",
    configureSession: o => o.AppendExecutionProvider_DML(0));

var (reference, _) = WavAudio.ReadPcm16("voice.wav"); // 24 kHz mono

var result = model.Synthesize(
    reference,
    referenceText: "Transcript of the reference clip.",
    text: "And this is the new sentence to speak.");

File.WriteAllBytes("out.wav", result.ToWav());

Under the hood

A three-model pipeline.

Faithful to the F5-TTS ONNX export — the driver just runs the loop.

Input
Reference + text
24 kHz clip and its transcript
01
Preprocess
mel + RoPE + noise
02
Transformer ×N
NFE denoising steps
03
Decode
24 kHz waveform

The first of its kind

Why this didn't exist before.

Running F5-TTS meant Python. And exporting non-English checkpoints to ONNX produced garbled speech — the exporter assumed the newer architecture. We found the root cause, fixed it, and contributed it upstream in DakeQQ/F5-TTS-ONNX #74 (merged). Then wrapped the working pipeline in a clean .NET API.

The result is the first library that runs F5-TTS — in any language it supports — natively from .NET. A ready-to-use German model is provided; point it at any F5-TTS ONNX export for other languages.