rfc-7874

WebRTC Audio Codec and Processing Requirements

JM. Valin, C. Bran
date2016-05 streamIETF areawit wgrtcweb statusPROPOSED STANDARD pages7 canonicalhttps://www.rfc-editor.org/rfc/rfc7874 doi10.17487/RFC7874
This document outlines the audio codec and processing requirements for WebRTC endpoints.

Extracted elements (21)

design-rationale §5

No specific AEC algorithm or standard is mandated because the dominant WebRTC use case (notebook with built-in microphone and speakers) presents challenging echo cancellation problems without a single universally applicable remedy. AEC is RECOMMENDED but not required.

webrtc, realtime

design-rationale §3

Opus is RECOMMENDED to be offered before PCMA/PCMU for endpoints supporting sampling rates above 8 kHz because Opus provides higher quality, includes its own comfort noise mechanism, and natively supports wideband and fullband audio — making G.711 fallback unnecessary when both sides support Opus.

webrtc, realtime, rtp

design-rationale §4

The target audio level of -19 dBm0 aligns with ITU-T G.169 and G.115 recommendations. However, frequency normalization above 300 Hz (rather than the G.712 passband) is required because WebRTC audio is not constrained to the G.712 passband and can be sampled at 8–48 kHz or higher.

webrtc, realtime

interoperability-note §6

The mandatory codec requirements (Opus and G.711 PCMA/PCMU) ensure a minimum level of voice interoperability between WebRTC endpoints and legacy phone systems that support G.711, without requiring audio transcoding.

webrtc, realtime, voip

normative-requirement §5 SHOULD

A local endpoint MAY include a far-end echo canceller for cases where the remote endpoint lacks one, but when included, it SHOULD be disabled by default.

webrtc, realtime

normative-requirement §3 MUST

All Opus decoder modes MUST be supported on the decoder side; the choice of encoder-side modes is left to the implementer. Endpoints MAY use offer/answer to signal a preference for a particular mode or ptime.

webrtc, realtime, rtp

normative-requirement §3 MUST

DTMF events generated by a WebRTC endpoint MUST have a duration between 40 ms and 8000 ms (recommended default 100 ms), and the gap between events MUST be no less than 30 ms (recommended default 70 ms).

webrtc, realtime, rtp, voip

normative-requirement §5 SHOULD

Endpoints SHOULD allow the AEC and/or nonlinear processing (NLP) to be turned off for applications such as music, and SHOULD detect the presence of a headset and disable echo cancellation in that case.

webrtc, realtime

normative-requirement §3 SHOULD

Endpoints SHOULD suppress in-band DTMF tones when sending 'audio/telephone-event' events. Endpoints receiving RFC 4733 tones are only required to gracefully drop them; there is no API to inform JavaScript of received DTMF.

webrtc, realtime, rtp, voip

normative-requirement §3 RECOMMENDED

For endpoints capable of processing audio at sampling rates higher than 8 kHz, Opus SHOULD be offered before PCMA/PCMU in the SDP offer to prefer higher-quality wideband audio.

webrtc, realtime, rtp

normative-requirement §4 SHOULD NOT

For music or desktop-sharing applications, the audio level SHOULD NOT be automatically adjusted, and the endpoint SHOULD allow the user to set gain manually. Endpoints MAY increase gain before playback to compensate for devices calibrated for commercial music.

webrtc, realtime

normative-requirement §4 RECOMMENDED

If a WebRTC endpoint controls the entire audio-capture path, it is RECOMMENDED that gain be adjusted so an average speaker produces an RMS of 2600 (-19 dBm0). Software endpoints that do not control the full capture path SHOULD use AGC to dynamically adjust to 2600 +/- 6 dB.

webrtc, realtime

normative-requirement §4 SHOULD

The audio level for speech transmission SHOULD be normalized to -19 dBm0, considering only frequencies above 300 Hz regardless of sampling rate. The level SHOULD be adapted to avoid clipping, either by lowering gain or using a compressor.

webrtc, realtime, rtp

normative-requirement §3 REQUIRED

WebRTC endpoints are REQUIRED to implement Opus (RFC 6716 with RFC 7587 payload format), PCMA and PCMU (G.711 with RFC 3551 payload format), RFC 3389 comfort noise, and the 'audio/telephone-event' media type (RFC 4733). These form the mandatory baseline codec set.

webrtc, realtime, rtp

normative-requirement §3 MUST

WebRTC endpoints MUST support RFC 3389 comfort noise (CN) for streams encoded with G.711 or any other supported codec that does not provide its own CN. Use of RFC 3389 CN with Opus is NOT RECOMMENDED because Opus provides its own CN mechanism.

webrtc, realtime, rtp

normative-requirement §5 SHOULD

WebRTC endpoints SHOULD include acoustic echo cancellation (AEC) or another form of echo control. Endpoint AECs SHOULD be robust to ADC/DAC clock differences (e.g., webcam capture with separate soundcard playback), unless hardware guarantees a shared clock.

webrtc, realtime, voip

protocol-element §3

DTMF events 0–15 are REQUIRED to be generated and consumed by WebRTC endpoints: digits 0–9 (codes 0–9), '*' (code 10), '#' (code 11), and letters A–D (codes 12–15), all as defined in RFC 4733.

webrtc, realtime, rtp, voip

protocol-element §3

The mandatory WebRTC audio codec set consists of: Opus (RFC 6716/RFC 7587), G.711 PCMA and PCMU (ITU-T G.711/RFC 3551), RFC 3389 comfort noise, and RFC 4733 telephone-event DTMF. Additional codecs SHOULD be offered when available to maximize session establishment without transcoding.

webrtc, realtime, rtp

protocol-element §4

The recommended signal-energy normalization filter is a second-order Butterworth filter with a 300 Hz cutoff frequency, used to exclude low-frequency content when computing the -19 dBm0 active-speech RMS level.

webrtc, realtime

security-consideration §7

Implementers should consult RFC 6562 guidelines to determine whether variable bitrate (VBR) audio is appropriate for their application, as VBR can leak information about audio content through packet size patterns even when encrypted.

webrtc, security, realtime, rtp, crypto

security-consideration §7

Security considerations for the individual codecs are addressed in their respective specifications (RFC 6716, RFC 7587, RFC 3551, RFC 3389, RFC 4733). Encryption and authentication are out of scope for this document; implementers should consult the WebRTC security documents.

webrtc, security, realtime