--- title: PrimeTTS Streaming WASM emoji: 🔊 colorFrom: green colorTo: indigo sdk: static pinned: false short_description: Real-time streaming zh-TW + English TTS (WASM, no server) models: - Luigi/PrimeTTS --- # PrimeTTS · real-time streaming (WASM edition) Fully client-side port of [Luigi/PrimeTTS-Streaming](https://huggingface.co/spaces/Luigi/PrimeTTS-Streaming) (FastAPI + WebSocket) to a static Space that runs entirely in the browser — no server, no WebSocket. Type text, hear audio **stream chunk-by-chunk** (24 frames ≈ 384 ms each). - **Vocoder**: token-level MB-iSTFT-VITS split into `enc` (text→z, once) + `dec` (z-chunk→audio, per chunk, overlap-save), run via [onnxruntime-web](https://github.com/microsoft/onnxruntime) (WASM). - **Frontend**: g2pw (BERT ONNX, bopomofo/Taiwan readings) + CMU-dict-based English g2p — ported to plain JS, BERT inference via onnxruntime-web. - **Streaming-input demo**: two GGUF LLMs (llama2.c-zh 15M story generator, Gemma-3-270m-it chat) run via [wllama](https://github.com/ngxson/wllama) (llama.cpp compiled to WASM); OpenCC (opencc-js) converts to zh-TW. - **UI**: static HTML + Web Audio API, PCM chunks played as they arrive. All model weights (~600 MB total: 2 ONNX vocoder splits, 1 ONNX g2p model, 2 GGUF LLMs) are fetched lazily from the [Luigi/PrimeTTS](https://huggingface.co/Luigi/PrimeTTS) model repo on first use and cached by the browser — nothing is bundled into this Space. zh-TW + English, 16 kHz. ## Local development ```bash npm install npm run dev # http://localhost:5173 npm run build # outputs dist/ ```