Internet Engineering Task Force (IETF) JM. Valin Request for Comments: 7874 Mozilla Category: Standards Track C. Bran ISSN: 2070-1721 Plantronics May 2016
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
WebRTC音频编解码器和处理要求
Abstract
摘要
This document outlines the audio codec and processing requirements for WebRTC endpoints.
本文档概述了WebRTC端点的音频编解码器和处理要求。
Status of This Memo
关于下段备忘
This is an Internet Standards Track document.
这是一份互联网标准跟踪文件。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.
本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7874.
有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc7874.
Copyright Notice
版权公告
Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.
版权所有(c)2016 IETF信托基金和确定为文件作者的人员。版权所有。
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。
Table of Contents
目录
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Codec Requirements . . . . . . . . . . . . . . . . . . . . . 2 4. Audio Level . . . . . . . . . . . . . . . . . . . . . . . . . 4 5. Acoustic Echo Cancellation (AEC) . . . . . . . . . . . . . . 4 6. Legacy VoIP Interoperability . . . . . . . . . . . . . . . . 5 7. Security Considerations . . . . . . . . . . . . . . . . . . . 5 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 8.1. Normative References . . . . . . . . . . . . . . . . . . 6 8.2. Informative References . . . . . . . . . . . . . . . . . 6 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Codec Requirements . . . . . . . . . . . . . . . . . . . . . 2 4. Audio Level . . . . . . . . . . . . . . . . . . . . . . . . . 4 5. Acoustic Echo Cancellation (AEC) . . . . . . . . . . . . . . 4 6. Legacy VoIP Interoperability . . . . . . . . . . . . . . . . 5 7. Security Considerations . . . . . . . . . . . . . . . . . . . 5 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 8.1. Normative References . . . . . . . . . . . . . . . . . . 6 8.2. Informative References . . . . . . . . . . . . . . . . . 6 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
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.
Web实时通信(WebRTC)的成功和采用的一个组成部分是WebRTC应用程序之间的语音和视频互操作性。本规范将概述WebRTC端点的音频处理和编解码器要求。
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].
本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”应按照RFC 2119[RFC2119]中的说明进行解释。
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.
为确保WebRTC端点之间的互操作性达到基线水平,下面指定了所需的最低编解码器集。如果WebRTC端点可以使用其他合适的音频编解码器,建议也将其包括在报价中,以最大限度地提高在不需要音频转码的情况下建立会话的可能性。
WebRTC endpoints are REQUIRED to implement the following audio codecs:
WebRTC端点需要实现以下音频编解码器:
o Opus [RFC6716] with the payload format specified in [RFC7587].
o Opus[RFC6716],具有[RFC7587]中指定的有效负载格式。
o PCMA and PCMU (as specified in ITU-T Recommendation G.711 [G.711]) with the payload format specified in Section 4.5.14 of [RFC3551].
o PCMA和PCMU(按照ITU-T建议G.711[G.711]的规定),有效载荷格式见[RFC3551]第4.5.14节。
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.
o [RFC3389]舒适性噪音(CN)。WebRTC端点必须支持使用G.711编码的流的[RFC3389]CN,或任何其他不提供自己CN的受支持编解码器。由于Opus提供了自己的CN机制,因此不建议在Opus中使用[RFC3389]CN。发送方使用不连续传输(DTX)/CN是可选的。
o the 'audio/telephone-event' media type as specified in [RFC4733]. The endpoints MAY send DTMF events at any time and SHOULD suppress in-band dual-tone multi-frequency (DTMF) tones, if any. DTMF events generated by a WebRTC endpoint MUST have a duration of no more than 8000 ms and no less than 40 ms. The recommended default duration is 100 ms for each tone. The gap between events MUST be no less than 30 ms; the recommended default gap duration is 70 ms. WebRTC endpoints are not required to do anything with tones (as specified in RFC 4733) sent to them, except gracefully drop them. There is currently no API to inform JavaScript about the received DTMF or other tones (as specified in RFC 4733). WebRTC endpoints are REQUIRED to be able to generate and consume the following events:
o [RFC4733]中规定的“音频/电话事件”媒体类型。端点可随时发送DTMF事件,并应抑制带内双音多频(DTMF)音调(如果有)。WebRTC端点生成的DTMF事件的持续时间不得超过8000 ms,也不得小于40 ms。建议每个音调的默认持续时间为100 ms。事件之间的间隔不得小于30ms;建议的默认间隔持续时间为70毫秒。WebRTC端点不需要对发送给它们的音调(如RFC 4733中所指定)执行任何操作,除非优雅地删除它们。目前没有API通知JavaScript接收到的DTMF或其他音调(如RFC 4733中所指定)。WebRTC端点需要能够生成和使用以下事件:
+------------+--------------------------------+-----------+ |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] | +------------+--------------------------------+-----------+
+------------+--------------------------------+-----------+ |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.
对于端点能够以高于8 kHz的采样率处理音频的所有情况,建议在PCMA/PCMU之前提供OPU。对于OPU,解码器端必须支持所有模式。编码器端模式的选择留给实现者。端点可以使用提供/应答机制来表示对特定模式或ptime的偏好。
For additional information on implementing codecs other than the mandatory-to-implement codecs listed above, refer to [RFC7875].
有关实现上述编解码器的强制要求以外的编解码器的更多信息,请参阅[RFC7875]。
It 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.
希望对语音传输的“在线”音频电平进行标准化,以避免用户必须手动调整回放,并促进会议应用中的混音。还需要与ITU-T建议G.169和G.115保持一致,其中建议活动音频电平为-19 dBm0。然而,与G.169和G.115不同,WebRTC音频不受G.712规定通带的限制,事实上,可以以8到48 kHz及更高的任何采样率进行采样。因此,无论使用何种采样率,应通过仅考虑300 Hz以上的频率来标准化电平。通过将增益降低到-19 dBm0以下或通过使用压缩器,还应调整电平以避免削波。
Assuming linear 16-bit PCM with a value of +/-32767, -19 dBm0 corresponds to a root mean square (RMS) level of 2600. Only active speech should be considered in the RMS calculation. If the endpoint has control over the entire audio-capture path, as is typically the case for a regular phone, then it is RECOMMENDED that the gain be adjusted in such a way that an average speaker would have a level of 2600 (-19 dBm0) for active speech. If the endpoint does not have control over the entire audio capture, as is typically the case for a software endpoint, then the endpoint SHOULD use automatic gain control (AGC) to dynamically adjust the level to 2600 (-19 dBm0) +/- 6 dB. For music- or desktop-sharing applications, the level SHOULD NOT be automatically adjusted, and the endpoint SHOULD allow the user to set the gain manually.
假设线性16位PCM的值为+/-32767,-19 dBm0对应于2600的均方根(RMS)电平。RMS计算中只应考虑活动语音。如果端点可以控制整个音频捕获路径,如普通电话的典型情况,则建议调整增益,使平均扬声器的活跃语音电平为2600(-19 dBm0)。如果端点不能控制整个音频捕获,如软件端点的典型情况,则端点应使用自动增益控制(AGC)将电平动态调整为2600(-19 dBm0)+/-6 dB。对于音乐或桌面共享应用程序,级别不应自动调整,端点应允许用户手动设置增益。
The RECOMMENDED filter for normalizing the signal energy is a second-order Butterworth filter with a 300 Hz cutoff frequency.
建议使用截止频率为300 Hz的二阶巴特沃斯滤波器来规范化信号能量。
It is common for the audio output on some devices to be "calibrated" for playing back pre-recorded "commercial" music, which is typically around 12 dB louder than the level recommended in this section. Because of this, endpoints MAY increase the gain before playback.
一些设备上的音频输出通常需要进行“校准”,以播放预先录制的“商业”音乐,通常比本节中建议的音量高12 dB左右。因此,端点可能会在播放前增加增益。
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
近中期WebRTC的主要使用模式可能是人们通过内置麦克风和扬声器的笔记本电脑上运行的网络浏览器,使用交互式音频和视频功能进行相互通信。笔记本电脑作为通讯设备的范例具有挑战性
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.
回声消除问题,此处不强制要求采取具体补救措施。然而,虽然WebRTC兼容的端点不需要特定的算法或标准,但回音消除将改善用户体验,应该由端点设备实现。
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.
WebRTC端点应包括AEC或其他形式的回显控制。在通用平台(如PC)上,用于音频捕获的模数转换器(ADC)和用于音频播放的数模转换器(DAC)通常使用不同的时钟。在这些情况下,例如当使用网络摄像头进行捕获并使用单独的声卡进行播放时,采样率可能会略有不同。端点AEC应对此类条件具有鲁棒性,除非它们与硬件一起提供,以确保从同一时钟采样捕获和回放。
Endpoints SHOULD allow the entire AEC and/or the nonlinear processing (NLP) to be turned off for applications, such as music, that do not behave well with the spectral attenuation methods typically used in NLP. Similarly, endpoints SHOULD have the ability to detect the presence of a headset and disable echo cancellation.
端点应允许关闭整个AEC和/或非线性处理(NLP),以用于与NLP中通常使用的光谱衰减方法不匹配的应用,如音乐。类似地,端点应该能够检测耳机的存在并禁用回声消除。
For some applications where the remote endpoint may not have an echo canceller, the local endpoint MAY include a far-end echo canceller, but when included, it SHOULD be disabled by default.
对于远程端点可能没有回音消除器的某些应用程序,本地端点可能包括远端回音消除器,但如果包括,则默认情况下应禁用。
The codec requirements above will ensure, at a minimum, voice interoperability capabilities between WebRTC endpoints and legacy phone systems that support G.711.
上述编解码器要求将至少确保WebRTC端点和支持G.711的传统电话系统之间的语音互操作能力。
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].
有关编解码器本身的安全注意事项,请参考其规范,包括[RFC6716]、[RFC7587]、[RFC3551]、[RFC3389]和[RFC4733]。同样,有关基于RTP的安全注意事项,请参考RTP基本规范。[WebRTC SEC]、[WebRTC SEC ARCH]和[WebRTC RTP用法]中进一步讨论了WebRTC安全性。
Using the guidelines in [RFC6562], implementers should consider whether the use of variable bitrate is appropriate for their application. Encryption and authentication issues are beyond the scope of this document.
使用[RCF6562]中的准则,实施者应该考虑变量比特率的使用是否适合于它们的应用。加密和身份验证问题超出了本文档的范围。
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <http://www.rfc-editor.org/info/rfc2119>.
[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<http://www.rfc-editor.org/info/rfc2119>.
[RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video Conferences with Minimal Control", STD 65, RFC 3551, DOI 10.17487/RFC3551, July 2003, <http://www.rfc-editor.org/info/rfc3551>.
[RFC3551]Schulzrinne,H.和S.Casner,“具有最小控制的音频和视频会议的RTP配置文件”,STD 65,RFC 3551,DOI 10.17487/RFC3551,2003年7月<http://www.rfc-editor.org/info/rfc3551>.
[RFC3389] Zopf, R., "Real-time Transport Protocol (RTP) Payload for Comfort Noise (CN)", RFC 3389, DOI 10.17487/RFC3389, September 2002, <http://www.rfc-editor.org/info/rfc3389>.
[RFC3389]Zopf,R.,“舒适噪声(CN)的实时传输协议(RTP)有效载荷”,RFC 3389,DOI 10.17487/RFC3389,2002年9月<http://www.rfc-editor.org/info/rfc3389>.
[RFC4733] Schulzrinne, H. and T. Taylor, "RTP Payload for DTMF Digits, Telephony Tones, and Telephony Signals", RFC 4733, DOI 10.17487/RFC4733, December 2006, <http://www.rfc-editor.org/info/rfc4733>.
[RFC4733]Schulzrinne,H.和T.Taylor,“DTMF数字、电话铃声和电话信号的RTP有效载荷”,RFC 4733,DOI 10.17487/RFC4733,2006年12月<http://www.rfc-editor.org/info/rfc4733>.
[RFC6716] Valin, JM., Vos, K., and T. Terriberry, "Definition of the Opus Audio Codec", RFC 6716, DOI 10.17487/RFC6716, September 2012, <http://www.rfc-editor.org/info/rfc6716>.
[RFC6716]Valin,JM.,Vos,K.,和T.Terriberry,“作品音频编解码器的定义”,RFC 6716,DOI 10.17487/RFC6716,2012年9月<http://www.rfc-editor.org/info/rfc6716>.
[RFC6562] Perkins, C. and JM. Valin, "Guidelines for the Use of Variable Bit Rate Audio with Secure RTP", RFC 6562, DOI 10.17487/RFC6562, March 2012, <http://www.rfc-editor.org/info/rfc6562>.
[RFC6562]Perkins,C.和JM。Valin,“带安全RTP的可变比特率音频使用指南”,RFC 6562,DOI 10.17487/RFC6562,2012年3月<http://www.rfc-editor.org/info/rfc6562>.
[RFC7587] Spittka, J., Vos, K., and JM. Valin, "RTP Payload Format for the Opus Speech and Audio Codec", RFC 7587, DOI 10.17487/RFC7587, June 2015, <http://www.rfc-editor.org/info/rfc7587>.
[RFC7587]Spittka,J.,Vos,K.,和JM。Valin,“Opus语音和音频编解码器的RTP有效载荷格式”,RFC 7587,DOI 10.17487/RFC7587,2015年6月<http://www.rfc-editor.org/info/rfc7587>.
[G.711] ITU-T, "Pulse code modulation (PCM) of voice frequencies", ITU-T Recommendation G.711, November 1988, <http://www.itu.int/rec/T-REC-G.711-198811-I/en>.
[G.711]ITU-T,“语音频率的脉冲编码调制(PCM)”,ITU-T建议G.711,1988年11月<http://www.itu.int/rec/T-REC-G.711-198811-I/en>.
[WebRTC-SEC] Rescorla, E., "Security Considerations for WebRTC", Work in Progress, draft-ietf-rtcweb-security-08, February 2015.
[WebRTC SEC]Rescorla,E.,“WebRTC的安全注意事项”,正在进行的工作,草稿-ietf-rtcweb-Security-082015年2月。
[WebRTC-SEC-ARCH] Rescorla, E., "WebRTC Security Architecture", Work in Progress, draft-ietf-rtcweb-security-arch-11, March 2015.
[WebRTC SEC ARCH]Rescorla,E.,“WebRTC安全架构”,正在进行的工作,草稿-ietf-rtcweb-Security-ARCH-11,2015年3月。
[WebRTC-RTP-USAGE] Perkins, C., Westerlund, M., and J. Ott, "Web Real-Time Communication (WebRTC): Media Transport and Use of RTP", Work in Progress, draft-ietf-rtcweb-rtp-usage-26, March 2016.
[WebRTC RTP使用]Perkins,C.,Westerlund,M.,和J.Ott,“网络实时通信(WebRTC):媒体传输和RTP的使用”,正在进行的工作,草稿-ietf-rtcweb-RTP-USAGE-26,2016年3月。
[RFC7875] Proust, S., Ed., "Additional WebRTC Audio Codecs for Interoperability", RFC 7875, DOI 10.17487/RFC7875, May 2016, <http://www.rfc-editor.org/info/rfc7875>.
[RFC7875]普鲁斯特,S.,编辑,“用于互操作性的附加WebRTC音频编解码器”,RFC 7875,DOI 10.17487/RFC7875,2016年5月<http://www.rfc-editor.org/info/rfc7875>.
Acknowledgements
致谢
This document incorporates ideas and text from various other documents. In particular, we would like to acknowledge, and say thanks for, work we incorporated from Harald Alvestrand and Cullen Jennings.
本文件包含了各种其他文件的想法和文本。特别是,我们要感谢Harald Alvestrand和Cullen Jennings为我们所做的工作。
Authors' Addresses
作者地址
Jean-Marc Valin Mozilla 331 E. Evelyn Avenue Mountain View, CA 94041 United States
Jean-Marc Valin Mozilla 331 E.Evelyn Avenue Mountain View,加利福尼亚州94041
Email: jmvalin@jmvalin.ca
Email: jmvalin@jmvalin.ca
Cary Bran Plantronics 345 Encinial Street Santa Cruz, CA 95060 United States
美国加利福尼亚州圣克鲁斯恩尼亚尔街345号卡里布兰植物电子公司,邮编95060
Phone: +1 206 661-2398 Email: cary.bran@plantronics.com
Phone: +1 206 661-2398 Email: cary.bran@plantronics.com