# Kuyil 1.4M Browser Voice

Interactive 100% client-side Tamil text-to-speech demo powered by Kuyil 1.4M in ONNX format. Runs locally in a WebAssembly Web Worker with zero server calls.

- Interactive tool: https://zhagaramlabs.com/tools/kuyil/
- Model page: https://zhagaramlabs.com/models/kuyil/
- Weights on Hugging Face: https://huggingface.co/zhagaramlabs/kuyil-1.4m
- Source code: https://github.com/zhagaramlabs/kuyil

## How it works

1. **Rule-based Tamil frontend (`/tools/kuyil/frontend.js`):** Converts Tamil script, spoken Tamil numbers and `₹` amounts, and common English words into Kuyil's 74-symbol phone set (positional stop voicing, geminates, ற்ற/ன்ற clusters, and word-final reduced உ).
2. **5.53 MB ONNX bundle (`/models/kuyil/onnx/`):**
   - `kuyil_acoustic.onnx` (2.40 MB): predicts 20 FARGAN acoustic features per 10 ms frame for female (`0`) or male (`1`) voices.
   - `conditioning.onnx` (0.27 MB) + `vocoder_step.onnx` (2.86 MB): PiVo's FARGAN recurrent neural vocoder, generating 160 samples per frame followed by a 0.85 IIR de-emphasis filter.
3. **Zero-backend Web Worker (`/tools/kuyil/worker.js`):** Uses `onnxruntime-web` in single-threaded WASM mode (no `COOP/COEP` headers required), streams frame progress to the UI, and outputs a downloadable 16 kHz PCM-16 mono WAV file with measured synthesis latency and real-time factor (RTF).
