Repository navigation
TTS v1.1.0 — Laughter, Vocal Sounds & More Natural Speech
TTS v1.1.0 (tts.computer)
The voice can now laugh — on its own, between words, and while it speaks — and make 53 sounds that are not words. Still a single self-contained WebAssembly file (tts.wasm): zero external WASM imports, zero models, zero audio samples, with the complete JavaScript TTS SDK embedded inside it.
What's New
Laughter and vocal sounds. 53 sounds in six groups, performed by the same vocal tract that speaks, so every voice makes them as itself:
| Group | Sounds |
|---|---|
| Laughter | laugh chuckle giggle guffaw cackle snicker hoho hehe nervous evil |
| Breath | inhale exhale gasp sigh yawn sniff pant phew |
| Reactions | hmm mm mhm uh-huh uh-uh uh-oh uh um huh aha oh ooh aww ahh ugh eww |
| Voice | hum groan scream sob whimper |
| Mouth | shh psst tsk kiss brr grr raspberry whistle fweet |
| Body | cough ahem hiccup sneeze snore |
// As tags in a script, made by whoever is speaking:
await voice.playScript(`
[female] The projector fell off the table, [gasp] and everyone just carried on! [laugh]
[deep] [chuckle] Of course they did. [sigh] Mondays.
`);
// How strongly, how long, or for a set time:
voice.speakScript("[laugh=strong] [sigh length=1.5] [laugh=3s] [snore for=5s]");
// From code:
await voice.playSound("guffaw", { intensity: 0.9 });
const threeSeconds = voice.sound("laugh", { durationMs: 3000 });
TTS.sounds(); // [{ id, label, group, about }, …]A duration is met by performing more or less of the sound, not by playing it slower: three seconds of laughter has more calls in it. Each sound takes its place in words and segments (sound: "laugh"), so captions and lip-sync follow it.
Laughing while speaking. The new laughter setting (0–1) and the [chuckling], [laughing], [giggling] deliveries change how the words themselves are said: a little is a smile in the voice; more, and the laugh breaks into the stressed vowels and spills out after the sentence.
const amused = new TTS({ gender: "female", laughter: 0.6 });
await amused.play("I can't believe you actually did that!");
await voice.playScript("[female, laughing] And then he dropped it again! [/laughing] Anyway.");More natural speech. Pronouns and auxiliaries are no longer accented and dwelt on, the duration model is refitted, /k g/ bursts are compact and loudness is steadier from word to word.
| Held-out CMU Arctic sentences (male / female) | v1.0 | v1.1 | Human recordings |
|---|---|---|---|
| Phoneme error rate | 9% / 8% | 8% / 8% | 8–10% |
| Predicted naturalness (UTMOS, 1–5) | 3.55 / 3.59 | 3.61 / 3.63 | 4.3 |
On 30 further sentences that no tuning has seen, the same step is +0.03 / +0.08 naturalness and 1.8 / 2.6 points fewer misheard sounds.
Demo studio. Redesigned, with a sound palette that inserts or auditions any sound, a "Laughing while speaking" slider, and worked examples in the pronunciation trainer.
Licence. The repository now carries the Apache License 2.0 text (LICENSE).
How the sounds were checked
Nobody can tune fifty sounds by ear, so they are set against an AudioSet tagger (tools/sounds.py) and measurements of real recordings. The tagger hears laughter in all 20 laughs (ten kinds, two voices) and puts the right name on 46 of the 68 renderings it is asked about; the cough and the throat-clearing are recognised. The sneeze, the snore, the sob and the sniff are not yet: they have the measured shape but are still stylised.
Release Assets
tts.wasm— standalone self-contained WebAssembly binary (~1.9 MB, ~620 KB gzipped) with internal JSTTSglue (tts_glue_ptr/tts_glue_len) and raw C-ABI exportstts.js— optional ES module loader (import init, { TTS } from "./tts.js")tts.d.ts— full TypeScript declarationstts-demo-site.zip— the demo studio as an upload-ready static site
4-Line Single-File HTML Embed (tts.wasm only)
<script type="module">
const { instance: { exports: w } } = await WebAssembly.instantiateStreaming(fetch("./tts.wasm"));
const { TTS } = Function("wasm", new TextDecoder().decode(new Uint8Array(w.memory.buffer, w.tts_glue_ptr(), w.tts_glue_len())))(w);
const voice = new TTS();
await voice.play("Hello from tts.computer! [laugh]");
</script>Upgrading from v1.0.0
- The API is a superset of v1.0.0; existing code runs unchanged.
- The same text does not produce the same samples as v1.0.0: the prosody and durations changed.
[gasp]is now its own sound (it was another name for[inhale]).- A tag that names a sound (
[laugh],[cough],[hmm]…) is now performed; v1.0.0 read the word out.
Full changelog: v1.0.0...v1.1.0