A 4.5-million-parameter speech model learns new voices and sings in a browser
tiny-voca is an English text-to-speech model by Muhammed Nazeem, with 4.5 million parameters and two voices, F2 and M2. Without retraining it, the Voice Tuner builds new voices from those two, saves a voice as a 4 KB file that other pages and Python scripts can play, and makes that voice sing a hymn, alone or as a chorus of up to eight. It all runs in the browser. On Oskar's iPhone it speaks about 27 times faster than real time.
Oskar asked for each piece on 2026-11-16, and Claude Code on the web built and measured them. Whisper small.en, a speech recognizer, checked the words, and the Praat pitch tracker checked the notes. Neither measures how natural a voice sounds. Oskar has listened on his phone; nobody has run a formal listening test.
Eleven sliders change the voice and one kind of change costs intelligibility
tiny-voca stores each voice as two vectors of 192 numbers, one read alongside each phoneme and one at every 10.7 ms frame of audio. One slider moves both vectors along the line from F2 to M2 and past either end. Four more move them off that line in fixed random directions.
Those four set the limit. Their combined distance from the line, in units of the F2-to-M2 gap, decides whether words survive: of 12 random voices, every one within 1.13 was transcribed exactly, and six of the eight beyond 1.15 garbled a word. The page caps each slider at ±1, warns when the combined distance passes 1.0, and keeps its "Surprise me" voices inside 0.9.
Pitch, pitch movement and speed are inputs tiny-voca already had. Formant scale, brightness and breath reshape the filter it predicts for every frame, through which it passes a buzz and a hiss to make the waveform. At a formant scale of 0.94 the speaker sounds larger and older at the same pitch. All of these were clear at both ends of their ranges except speed ×2, which slurred one word; pitch movement and the low end of breath were not tested at their ends.
A saved voice is a 4 KB file that plays the same in pages and in Python
The file holds the two vectors and six numbers. A copy of the slider settings rides along so the tuner can reload it. tinyvoca.js plays the file in any web page, and speak.py plays it in Python with onnxruntime. From one file and one sentence, the tuner, the library and Python each produced 133,632 samples, with pitch within 5 cents (hundredths of a semitone) of each other at the 90th percentile. Ten preset voices ship as files, and a link such as example.html?text=…&voice=… speaks any text in any of them.
Told each phoneme's length and pitch the speech model sings within two cents of the notes
Two inputs override the model's own predictions: how many frames each phoneme lasts and the pitch of each frame. Lyrics are written in syllables (A-maz-ing grace) and notes as D4/1, or B4/.5~G4/.5 for a syllable held across two notes. Consonants keep roughly their spoken length and vowels fill the rest of each note. With both inputs off, the output is unchanged to the last sample.
The default song is the first verse of "Amazing Grace" in E. O. Excell's 1900 setting, in the public domain, 30.9 seconds long. Sung in four voices, the median note error was 0.7 to 1.4 cents, and every note Praat could measure landed within 50 cents of the score. Whisper missed 4 to 12 percent of the words, mostly "now am found", where both words stretch across two notes.
A chorus sings one score in up to eight voices on the lead's timing
The voice on the sliders leads, and up to seven more come from the "Surprise me" draw. Each added voice is detuned by a few cents and gets its own vibrato rate and place between left and right, and voices on the M2 side sing an octave below an F2 lead. All parts follow the lead's timing, so each of the verse's 111 phonemes starts on the same frame in every voice. A seed in the link brings back the same chorus. Four voices take about 9 seconds to make on a 4-core cloud machine. Whisper transcribed that mix exactly and missed one word with eight voices, and 94 percent of the voiced frames were within half a semitone of a melody note in some octave.
The page downloads 11 MB once and then works offline
The model is a 6.3 MB download. Most of its weights are 8-bit integers. The parts that set how long each phoneme lasts are 16-bit, since 8 bits there shifted the timing. The phonemizer, which turns text into phonemes, is a JavaScript port of tiny-voca's Python one and agreed with it on all 12,450 test sentences. A second visit loads from the browser's cache in about a second, network or not. tiny-voca speaks English only, and every voice here is built from the two it learned.