text-to-speech Β· audio Β· WASM Β· ~38 MB
This is the Portuguese checkpoint of Meta's MMS-TTS family β a distinct model from the English MMS-TTS demo: its own Portuguese character vocabulary and its own Portuguese-trained VITS weights, so it speaks Portuguese orthography β Γ§, the nasal Γ£/Γ΅, accented Γ‘/Γ©/Γ³ β and the Γ§ and Portuguese phonotactics β that the English model 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 Portuguese sentence comes out with slightly different rhythm every time.
| Model | Xenova/mms-tts-por (ONNX of facebook/mms-tts-por) |
|---|---|
| Task / pipeline | text-to-speech β VitsModel, Portuguese text tokens β 16 kHz waveform |
| Architecture | VITS: conditional VAE + normalizing-flow decoder + monotonic alignment + stochastic duration predictor. End-to-end β no separate vocoder. |
| Language | Portuguese (por) β one of 1000+ MMS languages, each its own checkpoint |
| Output | A mono Float32Array waveform at sampling_rate 16000 |
| Quantization | q8 (8-bit) ONNX (model_quantized.onnx) |
| Backend | WebAssembly (WASM) β runs anywhere; no WebGPU needed |
| Download | ~38 MB, 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 some Portuguese and press Sprechen (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 Portuguese 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.
A Portuguese 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 Portuguese speech everywhere, offline, privately.
MMS-TTS Portuguese is a one-liner with the text-to-speech pipeline β the Portuguese checkpoint is picked by its id:
import { pipeline } from "@huggingface/transformers";
const tts = await pipeline("text-to-speech", "Xenova/mms-tts-por", { dtype: "q8" });
const out = await tts("Ein einziges Netzwerk verwandelt Buchstaben direkt in eine Schallwelle.");
// 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 is the same call
with a different checkpoint (mms-tts-eng).