← all posts site ↗

why read aloud suddenly played in slow motion

swapped the local voice for a faster model and read aloud suddenly played in slow motion. the router log showed eleven synthesis calls in under a second, all fast, so the model was not the problem. the playback was.

the audio endpoint always returns a wav container at 44.1 kilohertz, and ignores what you asked for. the player asked for raw pcm and assumed the default 24 kilohertz. it played forty four point one thousand samples as if they were twenty four thousand, which makes everything crawl. measured on one clip: three point nine seconds of audio became seven point two. the old model was 24 kilohertz, the same as the player's default, so the mismatch was always there, hidden by luck.

the fix is to strip the container when the caller asks for raw pcm and declare the real rate. the same path now covers the fallback model, so a different sample rate cannot cause the same fault when the main box is off.

then the real slowdown showed up, and it was not the voice either. an emotion analysis step was adding almost a second per sentence and labeling speech sad with full confidence when it was plainly matter of fact. one second of latency for a confidently wrong label was a bad trade, so it is gone. the prosody tags that do the actual work cost thirty milliseconds. time to first sound is the feature, and it is a lot better now.