text-to-speech Β· audio Β· WASM Β· ~38 MB
MMS-TTS is a VITS model: a single, end-to-end network that turns text straight into a waveform β no separate vocoder stage. It's a different beast from Kokoro (a StyleTTS2 decoder) and SpeechT5 (encoder-decoder + HiFi-GAN): VITS is a conditional VAE with normalizing flows and a stochastic duration predictor, so the same sentence comes out with slightly different rhythm every time. This page runs the English checkpoint β one of 1000+ languages Meta released in the same family.
| Model | Xenova/mms-tts-eng (ONNX of facebook/mms-tts-eng) |
|---|---|
| Task / pipeline | text-to-speech β VitsModel, text tokens β 16 kHz waveform |
| Architecture | VITS: conditional VAE + normalizing-flow decoder + monotonic alignment + stochastic duration predictor. End-to-end β no separate vocoder. |
| Output | A mono Float32Array waveform at sampling_rate 16000 |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~38 MB per language, cached after first load |
| License | CC-BY-NC 4.0 (MMS weights) β non-commercial |
| Web APIs | WebAssembly, Web Workers, Web Audio (playback), Blob URLs, Canvas |
Type something and press Speak. Synthesis runs in a Web Worker; the audio and waveform below are the real output for this device. Press Speak again to hear how the stochastic duration predictor re-times the very same words.
There is no spectrogram-then-vocoder hop here: VITS predicts the waveform itself. Below is the actual 16 kHz waveform (the bar fills as it plays). The interesting part is timing β VITS decides how long each sound lasts with a stochastic module, so re-running the same text changes the duration. Press "Speak again" a few times and watch the length and rhythm shift; the panel tracks how much each run varies.
VITS is the pragmatic workhorse of open TTS: one self-contained network, small, CPU-friendly, and β via MMS β available in more than a thousand languages from a single recipe. It won't out-act a big expressive model, but it's the model you reach for when you need speech everywhere, offline, with no per-character bill and nothing leaving the device.
Type a line, hear it, see its waveform β the core move.
Multilingual: switch between languages and hear the same idea spoken in each.
Stochastic prosody lab β generate the same text many times and compare the timing.
Summarise a long passage with DistilBART, then have MMS read the summary aloud.
MMS-TTS is a one-liner with the text-to-speech pipeline β pick the language by its checkpoint:
import { pipeline } from "@huggingface/transformers";
const tts = await pipeline("text-to-speech", "Xenova/mms-tts-eng", { dtype: "q8" });
const out = await tts("One network turns letters directly into a sound wave.");
// out.audio β Float32Array waveform (mono)
// out.sampling_rate β 16000
// Run it again with the same text β a slightly different waveform (stochastic duration).
This page runs the pipeline inside a Web Worker so synthesis never blocks the interface, encodes the
returned Float32 samples to a WAV blob for the <audio> element, and draws the same
samples as the waveform under "See inside". Switch language by loading a different
mms-tts-<iso> checkpoint β same call, same shape.