SIP & WebRTC Latency
Instant Barge-In Cancellation & WebRTC AEC3 Tuning
How duplex echo cancellation and TTS buffer flushing prevent the agent from interrupting itself.
< 40 ms TTS flush · WebRTC AEC3 reference stream
Clearing Downstream Audio Queues on Interrupt
When Silero VAD detects user speech during agent playback, the worker must immediately close or flush the ElevenLabs WebSocket stream and send a LiveKit track-clear frame. Leaving 600 ms of buffered PCM in the SFU makes the agent talk over the caller.
Avoiding Speakerphone Self-Triggering
Caller speakerphone bleed loops agent audio back into the STT pipeline. Keeping WebRTC AEC3 active on browser clients and tuning SIP far-end energy thresholds prevents phantom barge-in loops.
Measured Pipeline Thresholds
| Immediate Track Flush | 25-40 ms cutoff | Natural human interruption feel |
| Unflushed RTP Ring Buffer | 450-800 ms bleed | Agent finishes sentence over caller |
| AEC3 + Energy Gate | < 1.5% self-triggers | Safe for mobile speakerphone calls |