Mandated Audio Codecs in WebRTC

This article provides a clear overview of the audio codecs that are natively supported and mandated by the WebRTC (Web Real-Time Communication) specification. To ensure seamless, cross-browser interoperability without requiring external plugins, the Internet Engineering Task Force (IETF) has established strict baseline requirements for audio codecs that every WebRTC-compliant browser and device must implement.

According to RFC 7874, there are two primary audio codecs mandated for all WebRTC endpoints: Opus and G.711.

1. Opus (The Default Standard)

Opus is the primary, default audio codec for WebRTC. It is a highly versatile, open-source, and royalty-free codec designed specifically for interactive speech and music transmission over the internet.

2. G.711 (Legacy Compatibility)

G.711 is a legacy, narrowband waveform audio codec operating at 64 kbps. The WebRTC specification mandates support for both of its primary companding algorithms: * PCMU (ยต-law): Primarily used in North America and Japan. * PCMA (A-law): Primarily used in Europe and the rest of the world.

While G.711 offers lower audio quality compared to Opus, its inclusion is mandatory to guarantee backward compatibility with the Public Switched Telephone Network (PSTN) and legacy Voice over IP (VoIP) systems.

Additional Requirements

In addition to Opus and G.711, the WebRTC specification requires endpoints to support: * DTMF (Dual-Tone Multi-Frequency): Mandated via RFC 4733 tones for touch-tone telephone interaction. * Comfort Noise (CN): Mandated via RFC 3389 to generate artificial background noise during silence suppression, ensuring users do not think the call has dropped.