Skip to main content
NewEpisode 3a is out: Carry the conversation onWatch →
Foundations: how a machine speaks · 0g

Playing while it is generated

How one 83-frame sentence (6.64 s) can play while it is still being generated. Each new idea comes first with toy numbers you can check by eye: a race between making and playing frames (time to first audio, stalls, a buffer), where 0f's window goes wrong when chunks are decoded alone, max error and RMS, recomputing context (enough for one layer, leaky for two), carrying each layer's last inputs into the next chunk, the tail a transposed conv spills, and the transformer's notes (keys and values). The real run: on this Mac a frame takes about 0.1 s to make and plays for 80 ms, so the first sound comes after about 0.27 s instead of almost 10, but playback stalls about a dozen times; chunks decoded alone give an error almost as loud as the speech; recomputing L frames shrinks it but is never exact and costs more the smaller the chunk; sglang-omni's default Qwen3TTSIncrementalDecoder carries its state into the next chunk and matches the whole decode to float rounding, running each frame once, for 2.6 MB per stream. Last, sglang-omni's chunk sizes 1, 2, 4, then 8, and the legacy decoder it falls back to.

Up next0h · Part 0 in one trip→