← All models

text-to-speech · audio · WASM · ~38 MB

MMS-TTS Spanish — end-to-end Spanish speech, one network

This is the Spanish checkpoint of Meta's MMS-TTS family — a distinct model from the English MMS-TTS demo and the German one: its own Spanish character vocabulary and its own Spanish-trained VITS weights, so it speaks Spanish orthography — the ñ, the accented vowels á/é/í/ó/ú, Spanish phonotactics — that the English and German models cannot. VITS is a conditional VAE with normalizing flows and a stochastic duration predictor: one end-to-end network from text straight to a waveform, no separate vocoder, and the same Spanish sentence comes out with slightly different rhythm every time.

At a glance

ModelXenova/mms-tts-spa (ONNX of facebook/mms-tts-spa)
Task / pipelinetext-to-speech — VitsModel, Spanish text tokens → 16 kHz waveform
ArchitectureVITS: conditional VAE + normalizing-flow decoder + monotonic alignment + stochastic duration predictor. End-to-end — no separate vocoder.
LanguageSpanish (spa) — one of 1000+ MMS languages, each its own checkpoint
OutputA mono Float32Array waveform at sampling_rate 16000
Quantizationq8 (8-bit) ONNX (model_quantized.onnx)
BackendWebAssembly (WASM) — runs anywhere; no WebGPU needed
Download~38 MB, cached after first load
LicenseCC-BY-NC 4.0 (MMS weights) — non-commercial
Web APIsWebAssembly, Web Workers, Web Audio (playback), Blob URLs, Canvas

Run it

Type some Spanish and press Hablar (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.

See inside — the waveform, and the stochastic duration predictor

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 Spanish 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.

Speak something to see its waveform and stats.

Why it matters

A Spanish voice that runs entirely on-device: no per-character bill, no text leaving the tab, and a tiny ~38 MB footprint you can ship inside a PWA or kiosk. VITS won't out-act a big expressive model, but it's the model you reach for when you need Spanish speech everywhere, offline, privately — and Spanish is a language with hundreds of millions of speakers across dozens of countries.

Use cases

Basics

Type a Spanish line, hear it, see its waveform — the core move.

Practical

A Spanish narrator: read a notification, a weather report or an article snippet aloud.

Wild

Stochastic prosody lab — generate the same Spanish text many times and compare the timing.

Multi-model

Type English, translate it to Spanish with MarianMT, then have MMS speak the Spanish.

How the API works

MMS-TTS Spanish is a one-liner with the text-to-speech pipeline — the Spanish checkpoint is picked by its id:

import { pipeline } from "@huggingface/transformers";

const tts = await pipeline("text-to-speech", "Xenova/mms-tts-spa", { dtype: "q8" });

const out = await tts("Una sola red convierte las letras directamente en una onda sonora.");
// 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". The English demo and German demo are the same call with a different checkpoint (mms-tts-eng / mms-tts-deu).

References