Dev.to WebDev 🛠 Dev 👁 2 📖 1 min read

Latency is the whole product in a voice AI app

Most voice AI demos feel fine for one turn. A real roleplay is different. If it pauses between turns, it stops feeling like practice and starts feeling like a form. The problem: Sales reps needed to practise live calls

Most voice AI demos feel fine for one turn. A real roleplay is different. If it pauses between turns, it stops feeling like practice and starts feeling like a form.

The problem:
Sales reps needed to practise live calls against an AI counterpart. The loop is speech in, transcription, a model turn conditioned on the scenario, and synthesised speech back out. It has to feel like a phone call, not a chatbot.

The approach:
I split the audio round trip into independently tunable stages: transcription, model turn and synthesis. Each one can be optimised or swapped without touching the others, which matters because the slowest stage changes depending on the provider and the day. Scenario state is carried across turns, so the AI counterpart stays in character for the length of a real call instead of drifting after a few exchanges.

Stack: Python, FastAPI, LangChain, OpenAI, ElevenLabs, speech-to-text

Result: A full duplex voice loop tuned stage by stage, scenario state that persists across a multi-turn call, and transcription and synthesis layers that can be swapped between providers.

The lesson: when latency is the product, treat every stage as its own component. You can't tune what you can't isolate.

Full breakdown → https://farzamazhar.com/#work

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.