Services

Accelerators

Resources

Company

Services

Accelerators

Resources

Company

/

WebRTC

WebRTC (Web Real-Time Communication)

WebRTC (Web Real-Time Communication) is the standard browsers use for live audio and video calls. It is how a caller in a browser talks to a voice AI agent with low delay. Media servers such as LiveKit use it to carry audio between callers and agents.

How it works

The browser captures the microphone, applies echo cancellation and noise suppression, encodes the audio with the Opus codec in packets of about 20 ms, and sends them over UDP. If a packet arrives late it is skipped, and a jitter buffer smooths small gaps. Over a TCP WebSocket, by contrast, one lost packet holds up everything behind it until it is resent (head-of-line blocking).

Connections are set up with ICE: each side tries direct and NAT-traversed routes. If a firewall blocks UDP, traffic falls back to a TURN relay, often over TCP or TLS on port 443. That works, but adds delay.

Why it matters in production

For voice agents, transport is part of the latency budget. Run media servers close to callers, open the UDP ports they need, monitor how many calls fall back to TCP relays, and test from real corporate and mobile networks, not just the office.

See also

On the One2N blog

References

  1. WebRTC project site

  2. WebRTC: Real-Time Communication in Browsers (W3C)

Comic about WebRTC: a browser tab sends mic audio through an Opus encoder as 20 ms UDP packets, 50 a second at 80 bytes each; when packet 3 is late, WebRTC skips it behind a jitter buffer, while on a TCP WebSocket packets 4 and 5 wait for 3; the browser has echo cancellation, noise suppression and gain control built in; if a firewall blocks UDP, a TURN relay over TCP connects the call, a bit slower.

Putting this into practice?

Talk to One2N about our AI engineering services

Talk to One2N about our AI engineering services