Our text-to-speech engine was never the slow part. That was the most useful thing we learned while chasing first-audio latency for Speakvora's streaming voice API.
One morning a brand-new customer's very first request took 1.83 seconds to make a sound. The same voice, a second later, answered in 0.13 seconds. Nothing in the model had changed. Everything around it had.
Here is what we measured, what we changed, and the numbers before and after. Every figure below is from our own logs; none of it is a vendor claim.
1. Stop paying for a handshake on every sentence
The biggest win was not in the engine at all.
A streaming request that asks for a fresh token each time pays for the token (150 to 330 ms on our serverless gateway) plus a new connection (35 to 90 ms) on every sentence. That is up to 400 ms before the engine even starts.
Fix: get one session token, keep the HTTP connection open, and send sentences down it.
- Per-sentence token + new connection: 185 to 420 ms of overhead before any audio
- Reused token + open connection: 21 to 38 ms to first audio, median about 23 ms
If your voice agent feels slow, check this before you touch the model.
2. Keep the engine warm (it was being swapped to disk)
That 1.83-second first call had a boring cause. Our serving machine had about 14 engine processes on 24 GB of RAM. Idle engines were quietly paged out to swap, and the first request after a quiet spell had to page them back in.
Fixes:
- Run fewer copies. We cut the replica count roughly in half, which freed about 6 to 7 GB of real memory.
- A small "warm keeper" speaks one short line through each engine process every 45 seconds, and backs off when the machine is under heat pressure or load.
Result: after four minutes of silence, the first request now takes 108 ms instead of 1,830 ms.
3. Give the engine a hot core
With one caller, our fastest engine took 115 ms to first audio. With several callers it was quicker per request, which made no sense until we realised the CPU was dropping into low-power states between requests.
Keeping one core busy in the engine process took single-caller first audio from 115 ms to 41 ms. It costs a little power. It is worth it.
4. Check the network you forgot about
The serving box was on Wi-Fi, and Wi-Fi power saving was putting the radio to sleep between packets. Ping to the router: 74 ms. A tiny keep-awake that sends a steady trickle of small packets brought it to 10 ms. (Ethernet is the real fix.)
Your latency budget includes every hop. Measure them.
5. Remove hops on the hot path
We had a CDN in front of the streaming endpoint because it felt like best practice. For a live stream it added about 30 ms and cached nothing.
We now let API keys go straight to the speech server, which checks a key table synced every 30 seconds and bills per character as before. Measured first audio on that path: 21 to 49 ms.
A CDN is great for files. It is a tax on a live stream.
6. Don't synthesize the same sentence twice
"Thanks for calling, how can I help?" does not need a neural network every time. Lines a business says again and again are made once, stored, and served as a file from the CDN, which is exactly where a CDN does help.
On 2 December we probed a stored clip 40 times through the CDN: median 40 ms, p95 157 ms, with no engine involved at all.
The short version
If your voice is slow, it is almost always handshakes, cold processes, or extra hops, not the voice model. Measure each one before you shop for a new engine.
Try it
Speakvora is a speech API with streaming and stored-line playback, and a self-hosted receptionist agent you pay for once. New accounts get 100,000 free characters, no card: https://speakvora.com
