Network Working Group                                         G. Herlein
Request for Comments: 5574                                   Independent
Category: Standards Track                                       J. Valin
                                                     Xiph.Org Foundation
                                                            A. Heggestad
                                                             Creytiv.com
                                                              A. Moizard
                                                                 Antisip
                                                               June 2009
        
Network Working Group                                         G. Herlein
Request for Comments: 5574                                   Independent
Category: Standards Track                                       J. Valin
                                                     Xiph.Org Foundation
                                                            A. Heggestad
                                                             Creytiv.com
                                                              A. Moizard
                                                                 Antisip
                                                               June 2009
        

RTP Payload Format for the Speex Codec

Speex编解码器的RTP有效负载格式

Status of This Memo

关于下段备忘

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2009 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

本文件受BCP 78和IETF信托在本文件出版之日生效的与IETF文件有关的法律规定的约束(http://trustee.ietf.org/license-info). 请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

Abstract

摘要

Speex is an open-source voice codec suitable for use in VoIP (Voice over IP) type applications. This document describes the payload format for Speex-generated bit streams within an RTP packet. Also included here are the necessary details for the use of Speex with the Session Description Protocol (SDP).

Speex是一种开源语音编解码器,适用于VoIP(voice over IP)类型的应用。本文档描述RTP数据包内Speex生成的比特流的有效负载格式。这里还包括将Speex与会话描述协议(SDP)一起使用的必要细节。

Table of Contents

目录

   1. Introduction ....................................................3
   2. Terminology .....................................................3
   3. RTP Usage for Speex .............................................3
      3.1. RTP Speex Header Fields ....................................3
      3.2. RTP Payload Format for Speex ...............................4
      3.3. Speex Payload ..............................................4
      3.4. Example Speex Packet .......................................5
      3.5. Multiple Speex Frames in an RTP Packet .....................5
   4. IANA Considerations .............................................6
      4.1. Media Type Registration ....................................6
           4.1.1. Registration of Media Type Audio/Speex ..............6
   5. SDP Usage of Speex ..............................................8
      5.1. Example Supporting All Modes, Prefer Mode 4 ...............10
      5.2. Example Supporting Only Modes 3 and 5 .....................10
      5.3. Example with Variable Bit-Rate and Comfort Noise ..........10
      5.4. Example with Voice Activity Detection .....................11
      5.5. Example with Multiple Sampling Rates ......................11
      5.6. Example with Ptime and Multiple Speex Frames ..............11
      5.7. Example with Complete Offer/Answer Exchange ...............12
   6. Implementation Guidelines ......................................12
   7. Security Considerations ........................................12
   8. Acknowledgments ................................................13
   9. References .....................................................13
      9.1. Normative References ......................................13
      9.2. Informative References ....................................13
        
   1. Introduction ....................................................3
   2. Terminology .....................................................3
   3. RTP Usage for Speex .............................................3
      3.1. RTP Speex Header Fields ....................................3
      3.2. RTP Payload Format for Speex ...............................4
      3.3. Speex Payload ..............................................4
      3.4. Example Speex Packet .......................................5
      3.5. Multiple Speex Frames in an RTP Packet .....................5
   4. IANA Considerations .............................................6
      4.1. Media Type Registration ....................................6
           4.1.1. Registration of Media Type Audio/Speex ..............6
   5. SDP Usage of Speex ..............................................8
      5.1. Example Supporting All Modes, Prefer Mode 4 ...............10
      5.2. Example Supporting Only Modes 3 and 5 .....................10
      5.3. Example with Variable Bit-Rate and Comfort Noise ..........10
      5.4. Example with Voice Activity Detection .....................11
      5.5. Example with Multiple Sampling Rates ......................11
      5.6. Example with Ptime and Multiple Speex Frames ..............11
      5.7. Example with Complete Offer/Answer Exchange ...............12
   6. Implementation Guidelines ......................................12
   7. Security Considerations ........................................12
   8. Acknowledgments ................................................13
   9. References .....................................................13
      9.1. Normative References ......................................13
      9.2. Informative References ....................................13
        
1. Introduction
1. 介绍

Speex is based on the Code Excited Linear Prediction [CELP] encoding technique with support for either narrowband (nominal 8 kHz), wideband (nominal 16 kHz), or ultra-wideband (nominal 32 kHz). The main characteristics can be summarized as follows:

Speex基于码激励线性预测[CELP]编码技术,支持窄带(标称8 kHz)、宽带(标称16 kHz)或超宽带(标称32 kHz)。主要特征可概括如下:

o Free software/open-source

o 自由软件/开源

o Integration of wideband and narrowband in the same bit-stream

o 在同一比特流中集成宽带和窄带

o Wide range of bit-rates available

o 广泛的比特率可用

o Dynamic bit-rate switching and variable bit-rate (VBR)

o 动态比特率切换和可变比特率(VBR)

o Voice Activity Detection (VAD, integrated with VBR)

o 语音活动检测(VAD,与VBR集成)

o Variable complexity

o 可变复杂性

The Speex codec supports a wide range of bit-rates from 2.15 kbit/s to 44 kbit/s. In some cases however, it may not be possible for an implementation to include support for all rates (e.g., because of bandwidth or RAM or CPU constraints). In those cases, to be compliant with this specification, implementations MUST support at least narrowband (8 kHz) encoding and decoding at 8 kbit/s bit-rate (narrowband mode 3). Support for narrowband at 15 kbit/s (narrowband mode 5) is RECOMMENDED and support for wideband at 27.8 kbit/s (wideband mode 8) is also RECOMMENDED. The sampling rate MUST be 8, 16 or 32 kHz. This specification defines only single channel audio (mono).

Speex编解码器支持从2.15 kbit/s到44 kbit/s的广泛比特率。然而,在某些情况下,实现可能不可能包括对所有速率的支持(例如,由于带宽或RAM或CPU限制)。在这些情况下,为了符合本规范,实现必须至少支持8 kbit/s比特率(窄带模式3)下的窄带(8 kHz)编码和解码。建议支持15 kbit/s的窄带(窄带模式5),也建议支持27.8 kbit/s的宽带(宽带模式8)。采样率必须为8、16或32 kHz。本规范仅定义单声道音频(mono)。

2. Terminology
2. 术语

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC2119 [RFC2119] and indicate requirement levels for compliant RTP implementations.

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC2119[RFC2119]中的描述进行解释,并指出符合RTP实施的要求级别。

3. RTP Usage for Speex
3. Speex的RTP使用
3.1. RTP Speex Header Fields
3.1. RTP Speex头字段

The RTP header is defined in the RTP specification [RFC3550]. This section defines how fields in the RTP header are used.

RTP头在RTP规范[RFC3550]中定义。本节定义如何使用RTP标头中的字段。

Payload Type (PT): The assignment of an RTP payload type for this packet format is outside the scope of this document; it is specified by the RTP profile under which this payload format is used, or signaled dynamically out-of-band (e.g., using SDP).

有效负载类型(PT):此数据包格式的RTP有效负载类型的分配不在本文档的范围内;它由使用此有效负载格式的RTP配置文件指定,或在带外动态发送信号(例如,使用SDP)。

Marker (M) bit: The M bit is set to one on the first packet sent after a silence period, during which packets have not been transmitted contiguously.

标记(M)位:在静默期之后发送的第一个数据包上,M位设置为1,在此期间数据包未连续传输。

Extension (X) bit: Defined by the RTP profile used.

扩展(X)位:由使用的RTP配置文件定义。

Timestamp: A 32-bit word that corresponds to the sampling instant for the first frame in the RTP packet.

时间戳:与RTP数据包中第一帧的采样瞬间相对应的32位字。

3.2. RTP Payload Format for Speex
3.2. Speex的RTP有效负载格式

The RTP payload for Speex has the format shown in Figure 1. No additional header fields specific to this payload format are required. For RTP-based transportation of Speex-encoded audio, the standard RTP header [RFC3550] is followed by one or more payload data blocks. An optional padding terminator may also be used.

Speex的RTP有效负载的格式如图1所示。不需要特定于此有效负载格式的其他标头字段。对于基于RTP的Speex编码音频传输,标准RTP报头[RFC3550]后跟一个或多个有效负载数据块。也可以使用可选的填充终止符。

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         RTP Header                            |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                 one or more frames of Speex ....              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        one or more frames of Speex ....       |    padding    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        
       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         RTP Header                            |
      +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
      |                 one or more frames of Speex ....              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |        one or more frames of Speex ....       |    padding    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        

Figure 1: RTP Payload for Speex

图1:Speex的RTP有效负载

3.3. Speex Payload
3.3. Speex有效载荷

For the purposes of packetizing the bit stream in RTP, it is only necessary to consider the sequence of bits as output by the Speex encoder [SPEEX], and present the same sequence to the decoder. The payload format described here maintains this sequence.

为了打包RTP中的比特流,仅需要考虑SPEX编码器[SPEEX ]的比特序列作为输出,并且将相同的序列呈现给解码器。此处描述的有效负载格式维护此序列。

A typical Speex frame, encoded at the maximum bit-rate, is approximately 110 octets and the total number of Speex frames SHOULD be kept less than the path MTU to prevent fragmentation. Speex frames MUST NOT be fragmented across multiple RTP packets.

以最大比特率编码的典型Speex帧约为110个八位字节,Speex帧的总数应保持小于路径MTU,以防止碎片。Speex帧不得在多个RTP数据包之间分段。

The Speex frames must be placed starting with the oldest frame and then continue consecutively in time.

Speex帧必须从最早的帧开始放置,然后在时间上连续放置。

An RTP packet MAY contain Speex frames of the same bit-rate or of varying bit-rates, since the bit-rate for a frame is conveyed in-band with the signal.

RTP分组可以包含相同比特率或变化比特率的Speex帧,因为帧的比特率与信号一起在频带中传送。

The encoding and decoding algorithm can change the bit-rate at any 20 msec frame boundary, with the bit-rate change notification provided in-band with the bit stream. Each frame contains both sampling rate (narrowband, wideband, or ultra-wideband) and "mode" (bit-rate) information in the bit stream. No out-of-band notification is required for the decoder to process changes in the bit-rate sent by the encoder.

编码和解码算法可以在任何20毫秒帧边界处改变比特率,并且比特率改变通知与比特流一起在频带中提供。每个帧包含位流中的采样率(窄带、宽带或超宽带)和“模式”(比特率)信息。解码器不需要带外通知来处理编码器发送的比特率变化。

The sampling rate MUST be either 8000 Hz, 16000 Hz, or 32000 Hz.

采样率必须为8000 Hz、16000 Hz或32000 Hz。

The RTP payload MUST be padded to provide an integer number of octets as the payload length. These padding bits are LSB-aligned (Least Significant Bit) in network octet order and consist of a 0 followed by all ones (until the end of the octet). This padding is only required for the last frame in the packet, and only to ensure the packet contents end on an octet boundary.

必须对RTP有效负载进行填充,以提供整数个八位字节作为有效负载长度。这些填充位按网络八位字节顺序与LSB对齐(最低有效位),并由0和所有位组成(直到八位字节结束)。这种填充仅用于数据包中的最后一帧,并且仅用于确保数据包内容以八位字节边界结束。

3.4. Example Speex Packet
3.4. Speex数据包示例

In the example below, we have a single Speex frame with 5 bits of padding to ensure the packet size falls on an octet boundary.

在下面的示例中,我们有一个带有5位填充的Speex帧,以确保数据包大小落在八位字节边界上。

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      RTP Header                               |
     +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
     |                        ..speex data..                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                        ..speex data..               |0 1 1 1 1|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        
      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      RTP Header                               |
     +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
     |                        ..speex data..                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                        ..speex data..               |0 1 1 1 1|
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        
3.5. Multiple Speex Frames in an RTP Packet
3.5. RTP数据包中的多个Speex帧

Below is an example of two Speex frames contained within one RTP packet. The Speex frame length in this example falls on an octet boundary so there is no padding.

下面是一个RTP数据包中包含的两个Speex帧的示例。本例中的Speex帧长度落在八位字节边界上,因此没有填充。

The Speex decoder [SPEEX] can detect the bit-rate from the payload and is responsible for detecting the 20 msec boundaries between each frame.

Speex解码器[Speex]可以检测来自有效载荷的比特率,并负责检测每个帧之间的20毫秒边界。

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      RTP Header                               |
     +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
     |                     ..speex frame 1..                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       ..speex frame 1..       |      ..speex frame 2..        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      ..speex frame 2..                        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        
      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      RTP Header                               |
     +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
     |                     ..speex frame 1..                         |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |       ..speex frame 1..       |      ..speex frame 2..        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      ..speex frame 2..                        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        
4. IANA Considerations
4. IANA考虑

This document defines the Speex media type.

本文档定义Speex介质类型。

4.1. Media Type Registration
4.1. 媒体类型注册

This section describes the media types and names associated with this payload format. The section registers the media types, as per RFC 4288 [RFC4288].

本节介绍与此有效负载格式关联的媒体类型和名称。该部分根据RFC 4288[RFC4288]注册媒体类型。

4.1.1. Registration of Media Type Audio/Speex
4.1.1. 注册媒体类型音频/Speex

Media type name: audio

媒体类型名称:音频

Media subtype name: speex

媒体子类型名称:speex

Required parameters:

所需参数:

rate: RTP timestamp clock rate, which is equal to the sampling rate in Hz. The sampling rate MUST be either 8000, 16000, or 32000.

速率:RTP时间戳时钟速率,等于以Hz为单位的采样速率。采样率必须为8000、16000或32000。

Optional parameters:

可选参数:

ptime: SHOULD be a multiple of 20 msec [RFC4566]

ptime:应为20毫秒的倍数[RFC4566]

maxptime: SHOULD be a multiple of 20 msec [RFC4566]

maxptime:应为20毫秒的倍数[RFC4566]

vbr: variable bit-rate - either 'on', 'off', or 'vad' (defaults to 'off'). If 'on', variable bit-rate is enabled. If 'off', disabled. If set to 'vad', then constant bit-rate is used, but silence will be encoded with special short frames to indicate a lack of voice for that period. This parameter is a preference to the encoder.

vbr:可变比特率-打开、关闭或vad(默认为关闭)。如果“开”,则启用可变比特率。如果“关闭”,则禁用。如果设置为“vad”,则使用恒定比特率,但静音将使用特殊短帧进行编码,以指示该时段缺少语音。此参数是编码器的首选项。

cng: comfort noise generation - either 'on' or 'off' (defaults to 'off'). If 'off', then silence frames will be silent; if 'on', then those frames will be filled with comfort noise. This parameter is a preference to the encoder.

cng:舒适性噪音产生-打开或关闭(默认为关闭)。如果“关闭”,则静音帧将静音;如果“打开”,则这些框架将充满舒适噪音。此参数是编码器的首选项。

mode: Comma-separated list of supported Speex decoding modes, in order of preference. The first is the most preferred and the remaining is in decreasing order of preference. The valid modes are different for narrowband and wideband, and are defined as follows:

模式:以逗号分隔的支持Speex解码模式列表,按优先顺序排列。第一种是最受欢迎的,其余的则按优先顺序递减。窄带和宽带的有效模式不同,定义如下:

         *  {1,2,3,4,5,6,7,8,any} for narrowband
        
         *  {1,2,3,4,5,6,7,8,any} for narrowband
        
         *  {0,1,2,3,4,5,6,7,8,9,10,any} for wideband and ultra-wideband
        
         *  {0,1,2,3,4,5,6,7,8,9,10,any} for wideband and ultra-wideband
        

The 'mode' parameters may contain multiple values. In this case, the remote party SHOULD configure its encoder using the first supported mode provided. When 'any' is used, the offerer indicates that it supports all decoding modes. The 'mode' parameter value MUST always be quoted. If the 'mode' parameter is not provided, the mode value is considered to be equivalent to 'mode="3,any"' in narrowband and 'mode="8,any"' in wideband and ultra-wideband. Note that each Speex frame does contain the mode (or bit-rate) that should be used to decode it. Thus, an application MUST be able to decode any Speex frame unless the SDP clearly specifies that some modes are not supported (e.g., by not including 'mode="any"'). Indicating support for a given set of decoding modes also implies that the implementation support the same encoding modes.

“模式”参数可能包含多个值。在这种情况下,远程方应使用提供的第一种支持模式配置其编码器。当使用“any”时,报价人表示其支持所有解码模式。必须始终引用“模式”参数值。如果未提供“mode”参数,则认为模式值在窄带中等同于“mode=”3,any“;在宽带和超宽带中等同于“mode=”8,any”。请注意,每个Speex帧都包含应用于解码的模式(或比特率)。因此,应用程序必须能够解码任何Speex帧,除非SDP明确指定不支持某些模式(例如,不包括“mode=”any“)。指示对给定解码模式集的支持还意味着实现支持相同的编码模式。

Encoding considerations:

编码注意事项:

This media type is framed and binary, see Section 4.8 in [RFC4288].

此媒体类型为帧和二进制,请参阅[RFC4288]中的第4.8节。

Security considerations: See Section 6.

安全注意事项:见第6节。

Interoperability considerations:

互操作性注意事项:

None.

没有一个

Published specification:

已发布的规范:

RFC 5574.

RFC5574。

Applications that use this media type:

使用此媒体类型的应用程序:

Audio streaming and conferencing applications.

音频流和会议应用程序。

Additional information: none.

其他信息:无。

Person and e-mail address to contact for further information:

联系人和电子邮件地址以获取更多信息:

Alfred E. Heggestad: aeh@db.org

阿尔弗雷德·赫格斯塔德:aeh@db.org

Intended usage: COMMON

预期用途:普通

Restrictions on usage:

使用限制:

This media type depends on RTP framing, and hence is only defined for transfer via RTP [RFC3550]. Transport within other framing protocols is not defined at this time.

此媒体类型取决于RTP帧,因此仅定义为通过RTP传输[RFC3550]。此时未定义其他帧协议内的传输。

Author: Alfred E. Heggestad

作者:阿尔弗雷德·E·赫格斯塔德

Change controller:

更改控制器:

IETF Audio/Video Transport working group delegated from the IESG.

IESG授权的IETF音频/视频传输工作组。

5. SDP Usage of Speex
5. Speex的SDP使用

The information carried in the media type specification has a specific mapping to fields in the Session Description Protocol (SDP) [RFC4566], which is commonly used to describe RTP sessions. When SDP is used to specify sessions employing the Speex codec, the mapping is as follows:

媒体类型规范中包含的信息与会话描述协议(SDP)[RFC4566]中的字段具有特定映射,该协议通常用于描述RTP会话。使用SDP指定使用Speex编解码器的会话时,映射如下:

o The media type ("audio") goes in SDP "m=" as the media name.

o 媒体类型(“音频”)以SDP“m=”作为媒体名称。

o The media subtype ("speex") goes in SDP "a=rtpmap" as the encoding name. The required parameter "rate" also goes in "a=rtpmap" as the clock rate.

o 媒体子类型(“speex”)以SDP“a=rtpmap”作为编码名称。所需的参数“rate”也作为时钟频率进入“a=rtpmap”。

o The parameters "ptime" and "maxptime" go in the SDP "a=ptime" and "a=maxptime" attributes, respectively.

o 参数“ptime”和“maxptime”分别位于SDP“a=ptime”和“a=maxptime”属性中。

o Any remaining parameters go in the SDP "a=fmtp" attribute by copying them directly from the media type string as a semicolon-separated list of parameter=value pairs.

o 通过直接从媒体类型字符串中以分号分隔的参数=值对列表形式复制其余参数,将其放入SDP“a=fmtp”属性中。

The tables below include the equivalence between modes and bit-rates for narrowband, wideband, and ultra-wideband. Also, the corresponding "Speex quality" setting (see SPEEX_SET_QUALITY in the Speex Codec Manual [SPEEX]) is included as an indication.

下表包括窄带、宽带和超宽带模式和比特率之间的等效性。此外,相应的“Speex质量”设置(参见Speex编解码器手册[Speex]中的Speex_设置_质量)也包括在内,作为指示。

                  +------+---------------+-------------+
                  | mode | Speex quality |   bit-rate  |
                  +------+---------------+-------------+
                  |   1  |       0       | 2.15 kbit/s |
                  |   2  |       2       | 5.95 kbit/s |
                  |   3  |     3 or 4    | 8.00 kbit/s |
                  |   4  |     5 or 6    | 11.0 kbit/s |
                  |   5  |     7 or 8    | 15.0 kbit/s |
                  |   6  |       9       | 18.2 kbit/s |
                  |   7  |      10       | 24.6 kbit/s |
                  |   8  |       1       | 3.95 kbit/s |
                  +------+---------------+-------------+
        
                  +------+---------------+-------------+
                  | mode | Speex quality |   bit-rate  |
                  +------+---------------+-------------+
                  |   1  |       0       | 2.15 kbit/s |
                  |   2  |       2       | 5.95 kbit/s |
                  |   3  |     3 or 4    | 8.00 kbit/s |
                  |   4  |     5 or 6    | 11.0 kbit/s |
                  |   5  |     7 or 8    | 15.0 kbit/s |
                  |   6  |       9       | 18.2 kbit/s |
                  |   7  |      10       | 24.6 kbit/s |
                  |   8  |       1       | 3.95 kbit/s |
                  +------+---------------+-------------+
        

Table 1: Mode vs. Bit-Rate for Narrowband

表1:窄带模式与比特率

   +------+---------------+-------------------+------------------------+
   | mode | Speex quality | wideband bit-rate |     ultra wideband     |
   |      |               |                   |        bit-rate        |
   +------+---------------+-------------------+------------------------+
   |   0  |       0       |    3.95 kbit/s    |       5.75 kbit/s      |
   |   1  |       1       |    5.75 kbit/s    |       7.55 kbit/s      |
   |   2  |       2       |    7.75 kbit/s    |       9.55 kbit/s      |
   |   3  |       3       |    9.80 kbit/s    |       11.6 kbit/s      |
   |   4  |       4       |    12.8 kbit/s    |       14.6 kbit/s      |
   |   5  |       5       |    16.8 kbit/s    |       18.6 kbit/s      |
   |   6  |       6       |    20.6 kbit/s    |       22.4 kbit/s      |
   |   7  |       7       |    23.8 kbit/s    |       25.6 kbit/s      |
   |   8  |       8       |    27.8 kbit/s    |       29.6 kbit/s      |
   |   9  |       9       |    34.2 kbit/s    |       36.0 kbit/s      |
   |  10  |       10      |    42.2 kbit/s    |       44.0 kbit/s      |
   +------+---------------+-------------------+------------------------+
        
   +------+---------------+-------------------+------------------------+
   | mode | Speex quality | wideband bit-rate |     ultra wideband     |
   |      |               |                   |        bit-rate        |
   +------+---------------+-------------------+------------------------+
   |   0  |       0       |    3.95 kbit/s    |       5.75 kbit/s      |
   |   1  |       1       |    5.75 kbit/s    |       7.55 kbit/s      |
   |   2  |       2       |    7.75 kbit/s    |       9.55 kbit/s      |
   |   3  |       3       |    9.80 kbit/s    |       11.6 kbit/s      |
   |   4  |       4       |    12.8 kbit/s    |       14.6 kbit/s      |
   |   5  |       5       |    16.8 kbit/s    |       18.6 kbit/s      |
   |   6  |       6       |    20.6 kbit/s    |       22.4 kbit/s      |
   |   7  |       7       |    23.8 kbit/s    |       25.6 kbit/s      |
   |   8  |       8       |    27.8 kbit/s    |       29.6 kbit/s      |
   |   9  |       9       |    34.2 kbit/s    |       36.0 kbit/s      |
   |  10  |       10      |    42.2 kbit/s    |       44.0 kbit/s      |
   +------+---------------+-------------------+------------------------+
        

Table 2: Mode vs. Bit-Rate for Wideband and Ultra-Wideband

表2:宽带和超宽带的模式与比特率

The Speex parameters indicate the decoding capabilities of the agent, and what the agent prefers to receive.

Speex参数表示代理的解码能力,以及代理希望接收的内容。

The Speex parameters in an SDP Offer/Answer exchange are completely orthogonal, and there is no relationship between the SDP Offer and the Answer.

SDP报价/应答交换中的Speex参数完全正交,SDP报价和应答之间没有关系。

Several Speex specific parameters can be given in a single a=fmtp line provided that they are separated by a semicolon:

可以在单个a=fmtp行中给出多个Speex特定参数,前提是这些参数用分号分隔:

             a=fmtp:97 mode="1,any";vbr=on
        
             a=fmtp:97 mode="1,any";vbr=on
        

Some example SDP session descriptions utilizing Speex encodings follow.

下面是使用Speex编码的一些示例SDP会话描述。

5.1. Example Supporting All Modes, Prefer Mode 4
5.1. 示例支持所有模式,首选模式4

The offerer indicates that it wishes to receive a Speex stream at 8000 Hz, and wishes to receive Speex 'mode 4'. It is important to understand that any other mode might still be sent by remote party: the device might have bandwidth limitation or might only be able to send 'mode="3"'. Thus, applications that support all decoding modes SHOULD include 'mode="any"' as shown in the example below:

报价人表示希望接收8000 Hz的Speex流,并希望接收Speex“模式4”。重要的是要了解,任何其他模式仍可能由远程方发送:设备可能有带宽限制,或者可能只能发送“mode=”3“。因此,支持所有解码模式的应用程序应包括“mode=”any“,如下例所示:

             m=audio 8088 RTP/AVP 97
             a=rtpmap:97 speex/8000
             a=fmtp:97 mode="4,any"
        
             m=audio 8088 RTP/AVP 97
             a=rtpmap:97 speex/8000
             a=fmtp:97 mode="4,any"
        
5.2. Example Supporting Only Modes 3 and 5
5.2. 仅支持模式3和5的示例

The offerer indicates the mode he wishes to receive (Speex 'mode 3'). This offer indicates mode 3 and mode 5 are supported and that no other modes are supported. The remote party MUST NOT configure its encoder using another Speex mode.

报价人指出他希望接收的模式(Speex“模式3”)。此报价表示支持模式3和模式5,不支持其他模式。远程方不得使用其他Speex模式配置其编码器。

             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 mode="3,5"
        
             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 mode="3,5"
        
5.3. Example with Variable Bit-Rate and Comfort Noise
5.3. 具有可变比特率和舒适噪声的示例

The offerer indicates that it wishes to receive variable bit-rate frames with comfort noise:

报价人表示希望接收具有舒适噪声的可变比特率帧:

             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 vbr=on;cng=on
        
             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 vbr=on;cng=on
        
5.4. Example with Voice Activity Detection
5.4. 语音活动检测示例

The offerer indicates that it wishes to use silence suppression. In this case, the vbr=vad parameter will be used:

报价人表示希望使用沉默抑制。在这种情况下,将使用vbr=vad参数:

             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 vbr=vad
        
             m=audio 8088 RTP/AVP 97
             a=rtmap:97 speex/8000
             a=fmtp:97 vbr=vad
        
5.5. Example with Multiple Sampling Rates
5.5. 具有多个采样率的示例

The offerer indicates that it wishes to receive Speex audio at 16000 Hz with mode 10 (42.2 kbit/s) or, alternatively, Speex audio at 8000 Hz with mode 7 (24.6 kbit/s). The offerer supports decoding all modes.

报价人表示希望在模式10(42.2 kbit/s)下接收16000 Hz的Speex音频,或者在模式7(24.6 kbit/s)下接收8000 Hz的Speex音频。报价人支持解码所有模式。

             m=audio 8088 RTP/AVP 97 98
             a=rtmap:97 speex/16000
             a=fmtp:97 mode="10,any"
             a=rtmap:98 speex/8000
             a=fmtp:98 mode="7,any"
        
             m=audio 8088 RTP/AVP 97 98
             a=rtmap:97 speex/16000
             a=fmtp:97 mode="10,any"
             a=rtmap:98 speex/8000
             a=fmtp:98 mode="7,any"
        
5.6. Example with Ptime and Multiple Speex Frames
5.6. 具有Ptime和多个Speex帧的示例

The "ptime" SDP attribute is used to denote the packetization interval (i.e., how many milliseconds of audio is encoded in a single RTP packet). Since Speex uses 20 msec frames, ptime values of multiples of 20 denote multiple Speex frames per packet. It is recommended to use ptime values that are a multiple of 20.

“ptime”SDP属性用于表示分组间隔(即,单个RTP分组中编码的音频毫秒数)。由于Speex使用20毫秒的帧,因此20的倍数的ptime值表示每个数据包有多个Speex帧。建议使用20的倍数的ptime值。

If ptime contains a value that is not multiple of 20, the internal interpretation of it should be rounded up to the nearest multiple of 20 before the number of Speex frames is calculated. For example, if the "ptime" attribute is set to 30, the internal interpretation should be rounded up to 40 and then used to calculate two Speex frames per packet.

如果ptime包含的值不是20的倍数,则在计算Speex帧数之前,应将其内部解释向上舍入到最接近的20倍。例如,如果“ptime”属性设置为30,则内部解释应四舍五入到40,然后用于计算每个数据包的两个Speex帧。

In the example below, the ptime value is set to 40, indicating that there are two frames in each packet.

在下面的示例中,ptime值设置为40,表示每个分组中有两个帧。

             m=audio 8088 RTP/AVP 97
             a=rtpmap:97 speex/8000
             a=ptime:40
        
             m=audio 8088 RTP/AVP 97
             a=rtpmap:97 speex/8000
             a=ptime:40
        

Note that the ptime parameter applies to all payloads listed in the media line and is not used as part of an a=fmtp directive.

请注意,ptime参数适用于媒体行中列出的所有有效载荷,不作为a=fmtp指令的一部分使用。

Care must be taken when setting the value of ptime so that the RTP packet size does not exceed the path MTU.

设置ptime值时必须小心,以使RTP数据包大小不超过路径MTU。

5.7. Example with Complete Offer/Answer Exchange
5.7. 完整报价/应答交换示例

The offerer indicates that it wishes to receive Speex audio at 16000 Hz or, alternatively, Speex audio at 8000 Hz. The offerer does support ALL modes because no mode is specified.

报价人表示希望接收16000 Hz的Speex音频或8000 Hz的Speex音频。由于未指定模式,因此报价人支持所有模式。

             m=audio 8088 RTP/AVP 97 98
             a=rtmap:97 speex/16000
             a=rtmap:98 speex/8000
        
             m=audio 8088 RTP/AVP 97 98
             a=rtmap:97 speex/16000
             a=rtmap:98 speex/8000
        

The answerer indicates that it wishes to receive Speex audio at 8000 Hz, which is the only sampling rate it supports. The answerer does support ALL modes because no mode is specified.

应答者表示希望接收8000 Hz的Speex音频,这是其支持的唯一采样率。应答器不支持所有模式,因为没有指定模式。

             m=audio 8088 RTP/AVP 99
             a=rtmap:99 speex/8000
        
             m=audio 8088 RTP/AVP 99
             a=rtmap:99 speex/8000
        
6. Implementation Guidelines
6. 实施准则

Implementations that support Speex are responsible for correctly decoding incoming Speex frames.

支持Speex的实现负责正确解码传入的Speex帧。

Each Speex frame does contain all needed information to decode itself. In particular, the 'mode' and 'ptime' values proposed in the SDP contents MUST NOT be used for decoding: those values are not needed to properly decode a RTP Speex stream.

每个Speex帧包含解码自身所需的所有信息。特别是,SDP内容中提出的“模式”和“ptime”值不得用于解码:正确解码RTP Speex流不需要这些值。

7. Security Considerations
7. 安全考虑

RTP packets using the payload format defined in this specification are subject to the security considerations discussed in the RTP specification [RFC3550], and any appropriate RTP profile. This implies that confidentiality of the media streams is achieved by encryption. Because the data compression used with this payload format is applied end-to-end, encryption may be performed after compression so there is no conflict between the two operations.

使用本规范中定义的有效负载格式的RTP数据包受RTP规范[RFC3550]和任何适当RTP配置文件中讨论的安全注意事项的约束。这意味着媒体流的机密性是通过加密实现的。由于与此有效负载格式一起使用的数据压缩是端到端应用的,因此可以在压缩之后执行加密,因此两个操作之间没有冲突。

A potential denial-of-service threat exists for data encodings using compression techniques that have non-uniform receiver-end computational load. The attacker can inject pathological datagrams into the stream that are complex to decode and cause the receiver to be overloaded. However, this encoding does not exhibit any significant non-uniformity.

使用压缩技术的数据编码存在潜在的拒绝服务威胁,这种压缩技术具有非均匀的接收端计算负载。攻击者可以向流中注入难以解码的病理数据报,并导致接收器过载。然而,这种编码并没有表现出任何显著的非均匀性。

As with any IP-based protocol, in some circumstances, a receiver may be overloaded simply by the receipt of too many packets, either desired or undesired. Network-layer authentication may be used to discard packets from undesired sources, but the processing cost of the authentication itself may be too high.

与任何基于IP的协议一样,在某些情况下,接收机可能仅仅因为接收了太多的数据包而过载,不管是想要的还是不想要的。网络层认证可用于丢弃来自不希望的源的数据包,但认证本身的处理成本可能过高。

8. Acknowledgments
8. 致谢

The authors would like to thank Equivalence Pty Ltd of Australia for their assistance in attempting to standardize the use of Speex in H.323 applications, and for implementing Speex in their open-source OpenH323 stack. The authors would also like to thank Brian C. Wiles <brian@streamcomm.com> of StreamComm for his assistance in developing the proposed standard for Speex use in H.323 applications.

作者要感谢澳大利亚Equivalence Pty Ltd在尝试标准化H.323应用程序中Speex的使用以及在其开源OpenH323堆栈中实现Speex方面提供的帮助。作者还要感谢Brian C.Wiles<brian@streamcomm.com>感谢StreamComm协助开发H.323应用中Speex使用的拟议标准。

The authors would also like to thank the following members of the Speex and AVT communities for their input: Ross Finlayson, Federico Montesino Pouzols, Henning Schulzrinne, Magnus Westerlund, Colin Perkins, and Ivo Emanuel Goncalves.

作者还要感谢Speex和AVT社区的以下成员的投入:罗斯·芬莱森、费德里科·蒙特西诺·普佐尔斯、亨宁·舒尔兹林纳、马格纳斯·韦斯特隆德、科林·帕金斯和伊沃·伊曼纽尔·冈卡尔维斯。

Thanks to former authors of this document; Simon Morlat, Roger Hardiman, and Phil Kerr.

感谢本文件的前作者;西蒙·莫拉特、罗杰·哈迪曼和菲尔·科尔。

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, "RTP: A Transport Protocol for Real-Time Applications", STD 64, RFC 3550, July 2003.

[RFC3550]Schulzrinne,H.,Casner,S.,Frederick,R.,和V.Jacobson,“RTP:实时应用的传输协议”,STD 64,RFC 35502003年7月。

[RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session Description Protocol", RFC 4566, July 2006.

[RFC4566]Handley,M.,Jacobson,V.,和C.Perkins,“SDP:会话描述协议”,RFC4566,2006年7月。

9.2. Informative References
9.2. 资料性引用

[CELP] Schroeder, M. and B. Atal, "Code-excited linear prediction(CELP): High-quality speech at very low bit rates", Proc. International Conference on Acoustics, Speech, and Signal Processing (ICASSP), Vol 10, pp. 937- 940, 1985, <http://www.ntis.gov/>.

[CELP]Schroeder,M.和B.Atal,“码激励线性预测(CELP):极低比特率下的高质量语音”,Proc。声学、语音和信号处理国际会议(ICASSP),第10卷,第937-940页,1985年<http://www.ntis.gov/>.

[RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and Registration Procedures", BCP 13, RFC 4288, December 2005.

[RFC4288]Freed,N.和J.Klensin,“介质类型规范和注册程序”,BCP 13,RFC 4288,2005年12月。

[SPEEX] Valin, J., "The Speex Codec Manual", <http://www.speex.org/docs/>.

[SPEEX]Valin,J.,“SPEEX编解码器手册”<http://www.speex.org/docs/>.

Authors' Addresses

作者地址

Greg Herlein Independent 2034 Filbert Street San Francisco, California 94123 United States

Greg Herlein独立2034旧金山榛子街,加利福尼亚94123美国

   EMail: gherlein@herlein.com
        
   EMail: gherlein@herlein.com
        

Jean-Marc Valin Xiph.Org Foundation

让-马克-瓦林-希普·奥格基金会

   EMail: jean-marc.valin@usherbrooke.ca
        
   EMail: jean-marc.valin@usherbrooke.ca
        

Alfred E. Heggestad Creytiv.com Biskop J. Nilssonsgt. 20a Oslo 0659 Norway

阿尔弗雷德·E·赫格斯塔德·克雷蒂夫·com比斯科普·J·尼尔森格特。20a奥斯陆0659挪威

   EMail: aeh@db.org
        
   EMail: aeh@db.org
        

Aymeric Moizard Antisip 5 Place Benoit Crepu Lyon, 69005 France

Aymeric Moizard Antisip 5 Place Benoit Crepu Lyon,法国69005

   EMail: jack@atosc.org
        
   EMail: jack@atosc.org