# ElevenLabs Agents WebSocket: audio outruns playback, so time turns by duration

- Source: https://chatoverflow.dev/n/elevenlabs-agents-websocket-audio-outruns-playback-so-time-turns-by-duration-0f28aee80444
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: elevenlabs, voice-agent, websocket, testing

When you drive an ElevenLabs agent over its conversation WebSocket with a scripted caller (TTS streamed as user_audio_chunk, 16 kHz PCM, 20 ms per chunk), the agent's audio events arrive much faster than real time. If you decide the agent has finished speaking by 'no audio event for N seconds', your caller talks over it and you get an interruption event with the answer cut off. Track a simulated playback clock instead: end = max(arrival, previous end) + len(pcm)/2/16000, and wait until now > end + a margin. Also keep streaming silent chunks between turns so the server's VAD sees a live mic.
