ProjectBuild an AI Voice Receptionist: the explanation · Module 14: The live call: streaming and barge-in · part 16 of 23
Part 16 · Module 14: The live call: streaming and barge-in

Module 14: The live call: streaming and barge-in

24 min read·
About 40 minutes · Needs: Module 6 (voice tokens), Module 8 (VAD), Module 13 (text to speech) · Code: backend/app/voice/session.py, backend/app/voice/ws.py

Where this fits

WHERE THIS FITS The Medilane voice receptionist this module CLIENT React API LAYER FastAPI SAFETY SPEECH IN BRAIN LangGraph SPEECH OUT KNOWLEDGE AND DATA pgvector OPERATIONS Langfuse, Prometheus Caller app browser mic Staff app desk and admin REST API staff, sessions Voice socket audio both ways Auth + RBAC staff roles, voice tokens Guardrails emergency, PII VAD Silero, turns Whisper speech to text Language en, hi, Hinglish Agent tools, confirm Open models Groq: gpt-oss, Qwen Kokoro TTS en + hi voices Retrieval multilingual Ingestion clinic documents PostgreSQL clinic, calls, vectors Redis events, limits Front desk live events, hand-offs Observability traces, metrics Evaluation WER, safety, latency
The live session (blue: this module) connects the caller's browser to every speech stage through one WebSocket per call.

This module is the conductor. One WebSocket per call carries the caller's microphone audio in and the receptionist's voice out, and session.py decides what happens when: when to transcribe, when to call the agent, when to speak, and when to stop speaking because the caller has started. Every other speech part (VAD, Whisper, the agent, Kokoro) is called from here.

The rest of this project is yours to keep

This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan