Internet Engineering Task Force (IETF) JM. Valin
Request for Comments: 7874 Mozilla
Category: Standards Track C. Bran
ISSN: 2070-1721 Plantronics
May 2016
WebRTC Audio Codec and Processing Requirements
Valin & Bran Standards Track [Page 1]
RFC 7874 WebRTC Audio May 2016
Table of Contents
1. Introduction
An integral part of the success and adoption of Web Real-Time Communications (WebRTC) will be the voice and video interoperability between WebRTC applications. This specification will outline the audio processing and codec requirements for WebRTC endpoints.
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
3. Codec Requirements
To ensure a baseline level of interoperability between WebRTC endpoints, a minimum set of required codecs are specified below. If other suitable audio codecs are available for the WebRTC endpoint to use, it is RECOMMENDED that they also be included in the offer in order to maximize the possibility of establishing the session without the need for audio transcoding.
Valin & Bran Standards Track [Page 2]
RFC 7874 WebRTC Audio May 2016
o [RFC3389] comfort noise (CN). WebRTC endpoints MUST support [RFC3389] CN for streams encoded with G.711 or any other supported codec that does not provide its own CN. Since Opus provides its own CN mechanism, the use of [RFC3389] CN with Opus is NOT RECOMMENDED. Use of Discontinuous Transmission (DTX) / CN by senders is OPTIONAL.
+------------+--------------------------------+-----------+
|Event Code | Event Name | Reference |
+------------+--------------------------------+-----------+
| 0 | DTMF digit "0" | [RFC4733] |
| 1 | DTMF digit "1" | [RFC4733] |
| 2 | DTMF digit "2" | [RFC4733] |
| 3 | DTMF digit "3" | [RFC4733] |
| 4 | DTMF digit "4" | [RFC4733] |
| 5 | DTMF digit "5" | [RFC4733] |
| 6 | DTMF digit "6" | [RFC4733] |
| 7 | DTMF digit "7" | [RFC4733] |
| 8 | DTMF digit "8" | [RFC4733] |
| 9 | DTMF digit "9" | [RFC4733] |
| 10 | DTMF digit "*" | [RFC4733] |
| 11 | DTMF digit "#" | [RFC4733] |
| 12 | DTMF digit "A" | [RFC4733] |
| 13 | DTMF digit "B" | [RFC4733] |
| 14 | DTMF digit "C" | [RFC4733] |
| 15 | DTMF digit "D" | [RFC4733] |
+------------+--------------------------------+-----------+
For all cases where the endpoint is able to process audio at a sampling rate higher than 8 kHz, it is RECOMMENDED that Opus be offered before PCMA/PCMU. For Opus, all modes MUST be supported on the decoder side. The choice of encoder-side modes is left to the implementer. Endpoints MAY use the offer/answer mechanism to signal a preference for a particular mode or ptime. For additional information on implementing codecs other than the mandatory-to-implement codecs listed above, refer to [RFC7875].
Valin & Bran Standards Track [Page 3]
RFC 7874 WebRTC Audio May 2016 4. Audio LevelIt is desirable to standardize the "on the wire" audio level for speech transmission to avoid users having to manually adjust the playback and to facilitate mixing in conferencing applications. It is also desirable to be consistent with ITU-T Recommendations G.169 and G.115, which recommend an active audio level of -19 dBm0. However, unlike G.169 and G.115, the audio for WebRTC is not constrained to have a passband specified by G.712 and can in fact be sampled at any sampling rate from 8 to 48 kHz and higher. For this reason, the level SHOULD be normalized by only considering frequencies above 300 Hz, regardless of the sampling rate used. The level SHOULD also be adapted to avoid clipping, either by lowering the gain to a level below -19 dBm0 or through the use of a compressor.
5. Acoustic Echo Cancellation (AEC)
It is plausible that the dominant near-to-medium-term WebRTC usage model will be people using the interactive audio and video capabilities to communicate with each other via web browsers running on a notebook computer that has a built-in microphone and speakers. The notebook-as-communication-device paradigm presents challenging echo cancellation problems, the specific remedy of which will not be mandated here. However, while no specific algorithm or standard will be required by WebRTC-compatible endpoints, echo cancellation will improve the user experience and should be implemented by the endpoint device.
Valin & Bran Standards Track [Page 4]
RFC 7874 WebRTC Audio May 2016
WebRTC endpoints SHOULD include an AEC or some other form of echo control. On general-purpose platforms (e.g., a PC), it is common for the analog-to-digital converter (ADC) for audio capture and the digital-to-analog converter (DAC) for audio playback to use different clocks. In these cases, such as when a webcam is used for capture and a separate soundcard is used for playback, the sampling rates are likely to differ slightly. Endpoint AECs SHOULD be robust to such conditions, unless they are shipped along with hardware that guarantees capture and playback to be sampled from the same clock.
6. Legacy VoIP Interoperability
The codec requirements above will ensure, at a minimum, voice interoperability capabilities between WebRTC endpoints and legacy phone systems that support G.711.
7. Security Considerations
For security considerations regarding the codecs themselves, please refer to their specifications, including [RFC6716], [RFC7587], [RFC3551], [RFC3389], and [RFC4733]. Likewise, consult the RTP base specification for RTP-based security considerations. WebRTC security is further discussed in [WebRTC-SEC], [WebRTC-SEC-ARCH], and [WebRTC-RTP-USAGE].
Valin & Bran Standards Track [Page 5]
RFC 7874 WebRTC Audio May 2016 8. References 8.1. Normative References[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
8.2. Informative References
[WebRTC-SEC]
Valin & Bran Standards Track [Page 6]
RFC 7874 WebRTC Audio May 2016
[WebRTC-SEC-ARCH]