CSE Roadmap

Specialist tier · about 3 hours · 12 parts

Part 5 of 12 · 2 min read

Writing for the ear, and hiding tool latency honestly

Text tolerates long sentences and lists; speech has to be shortened and timed differently.

Think of reading a recipe aloud to someone cooking versus handing them the printed card. Read aloud, you break it into short steps and check in, because they can't scan ahead or re-read a line.

In plain words: a reply written for a screen is too long and too dense to speak comfortably, and silence during a slow tool call needs to be filled honestly rather than left dead.

A worked example. The example's 35-word reply takes about 12.7 seconds to say at 165 words per minute but only about 7.6 seconds to read at 275. Speech is roughly 40 percent slower, which is why a voice reply needs shortening and read-back of exact details, not just a copy of the chat version. Separately, when a tool call has a median latency of 900 ms, playing a short filler immediately brings the p50 silence the caller hears from 895 ms down to 250 ms. It brings the p95 from 2,376 ms down to 1,176 ms.

The key lines. From code/mini-voice/speak.py:

# from code/mini-voice/speak.py
def for_voice(text, max_sentences=2, max_seconds=12):
    """Keep it short: the first sentences up to a time cap; offer to continue."""
    out, t = [], 0.0
    for s in sentences(text)[:max_sentences]:
        d = speech_seconds(s)
        if out and t + d > max_seconds: break
        out.append(s); t += d
    cut = len(out) < len(sentences(text))
    return " ".join(out) + (" Want the rest?" if cut else "")

Read it as: the function caps both sentence count and spoken seconds, then offers to continue rather than silently dropping the rest. A voice reply is actively shortened and checked against a time budget, not just trimmed by eye.

STT, TTS, filler

STT is speech-to-text; TTS is text-to-speech. A filler is a short spoken phrase ("one moment, I'm checking that") played while a slow tool runs, so the caller hears something rather than dead air.

Example: the 250 ms filler_start_ms in the silence-after-tool calculation above is how quickly the filler has to start for it to actually mask the 900 ms median tool delay.