1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
|
<pre>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
<span class="h1">RTP Payload Format for the Speex Codec</span>
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.
Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of
publication of this document (<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>).
Please review these documents carefully, as they describe your rights
and restrictions with respect to this document.
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).
<span class="grey">Herlein, et al. Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-3">3</a>
<a href="#section-2">2</a>. Terminology .....................................................<a href="#page-3">3</a>
<a href="#section-3">3</a>. RTP Usage for Speex .............................................<a href="#page-3">3</a>
<a href="#section-3.1">3.1</a>. RTP Speex Header Fields ....................................<a href="#page-3">3</a>
<a href="#section-3.2">3.2</a>. RTP Payload Format for Speex ...............................<a href="#page-4">4</a>
<a href="#section-3.3">3.3</a>. Speex Payload ..............................................<a href="#page-4">4</a>
<a href="#section-3.4">3.4</a>. Example Speex Packet .......................................<a href="#page-5">5</a>
<a href="#section-3.5">3.5</a>. Multiple Speex Frames in an RTP Packet .....................<a href="#page-5">5</a>
<a href="#section-4">4</a>. IANA Considerations .............................................<a href="#page-6">6</a>
<a href="#section-4.1">4.1</a>. Media Type Registration ....................................<a href="#page-6">6</a>
<a href="#section-4.1.1">4.1.1</a>. Registration of Media Type Audio/Speex ..............<a href="#page-6">6</a>
<a href="#section-5">5</a>. SDP Usage of Speex ..............................................<a href="#page-8">8</a>
<a href="#section-5.1">5.1</a>. Example Supporting All Modes, Prefer Mode 4 ...............<a href="#page-10">10</a>
<a href="#section-5.2">5.2</a>. Example Supporting Only Modes 3 and 5 .....................<a href="#page-10">10</a>
<a href="#section-5.3">5.3</a>. Example with Variable Bit-Rate and Comfort Noise ..........<a href="#page-10">10</a>
<a href="#section-5.4">5.4</a>. Example with Voice Activity Detection .....................<a href="#page-11">11</a>
<a href="#section-5.5">5.5</a>. Example with Multiple Sampling Rates ......................<a href="#page-11">11</a>
<a href="#section-5.6">5.6</a>. Example with Ptime and Multiple Speex Frames ..............<a href="#page-11">11</a>
<a href="#section-5.7">5.7</a>. Example with Complete Offer/Answer Exchange ...............<a href="#page-12">12</a>
<a href="#section-6">6</a>. Implementation Guidelines ......................................<a href="#page-12">12</a>
<a href="#section-7">7</a>. Security Considerations ........................................<a href="#page-12">12</a>
<a href="#section-8">8</a>. Acknowledgments ................................................<a href="#page-13">13</a>
<a href="#section-9">9</a>. References .....................................................<a href="#page-13">13</a>
<a href="#section-9.1">9.1</a>. Normative References ......................................<a href="#page-13">13</a>
<a href="#section-9.2">9.2</a>. Informative References ....................................<a href="#page-13">13</a>
<span class="grey">Herlein, et al. Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
Speex is based on the Code Excited Linear Prediction [<a href="#ref-CELP" title=""Code-excited linear prediction(CELP): High-quality speech at very low bit rates"">CELP</a>] 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:
o Free software/open-source
o Integration of wideband and narrowband in the same bit-stream
o Wide range of bit-rates available
o Dynamic bit-rate switching and variable bit-rate (VBR)
o Voice Activity Detection (VAD, integrated with VBR)
o Variable complexity
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).
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span>
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 <a href="./rfc2119">RFC2119</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>] and
indicate requirement levels for compliant RTP implementations.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. RTP Usage for Speex</span>
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. RTP Speex Header Fields</span>
The RTP header is defined in the RTP specification [<a href="./rfc3550" title=""RTP: A Transport Protocol for Real-Time Applications"">RFC3550</a>]. This
section defines how fields in the RTP header are used.
<span class="grey">Herlein, et al. Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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).
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.
Extension (X) bit: Defined by the RTP profile used.
Timestamp: A 32-bit word that corresponds to the sampling instant
for the first frame in the RTP packet.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. RTP Payload Format for Speex</span>
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 [<a href="./rfc3550" title=""RTP: A Transport Protocol for Real-Time Applications"">RFC3550</a>] is followed by one or more payload data
blocks. An optional padding terminator may also be used.
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
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>. Speex Payload</span>
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 [<a href="#ref-SPEEX" title=""The Speex Codec Manual"">SPEEX</a>], and present the same sequence to the decoder. The
payload format described here maintains this sequence.
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.
The Speex frames must be placed starting with the oldest frame and
then continue consecutively in time.
<span class="grey">Herlein, et al. Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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.
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.
The sampling rate MUST be either 8000 Hz, 16000 Hz, or 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.
<span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>. Example Speex Packet</span>
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.
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|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h3"><a class="selflink" id="section-3.5" href="#section-3.5">3.5</a>. Multiple Speex Frames in an RTP Packet</span>
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.
The Speex decoder [<a href="#ref-SPEEX" title=""The Speex Codec Manual"">SPEEX</a>] can detect the bit-rate from the payload
and is responsible for detecting the 20 msec boundaries between each
frame.
<span class="grey">Herlein, et al. Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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.. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. IANA Considerations</span>
This document defines the Speex media type.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. Media Type Registration</span>
This section describes the media types and names associated with this
payload format. The section registers the media types, as per <a href="./rfc4288">RFC</a>
<a href="./rfc4288">4288</a> [<a href="./rfc4288" title=""Media Type Specifications and Registration Procedures"">RFC4288</a>].
<span class="h4"><a class="selflink" id="section-4.1.1" href="#section-4.1.1">4.1.1</a>. Registration of Media Type Audio/Speex</span>
Media type name: audio
Media subtype name: 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.
Optional parameters:
ptime: SHOULD be a multiple of 20 msec [<a href="./rfc4566" title=""SDP: Session Description Protocol"">RFC4566</a>]
maxptime: SHOULD be a multiple of 20 msec [<a href="./rfc4566" title=""SDP: Session Description Protocol"">RFC4566</a>]
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.
<span class="grey">Herlein, et al. Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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.
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:
* {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
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.
Encoding considerations:
This media type is framed and binary, see <a href="./rfc4288#section-4.8">Section 4.8 in
[RFC4288]</a>.
Security considerations: See <a href="#section-6">Section 6</a>.
Interoperability considerations:
None.
Published specification:
<a href="./rfc5574">RFC 5574</a>.
<span class="grey">Herlein, et al. Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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
Intended usage: COMMON
Restrictions on usage:
This media type depends on RTP framing, and hence is only defined
for transfer via RTP [<a href="./rfc3550" title=""RTP: A Transport Protocol for Real-Time Applications"">RFC3550</a>]. Transport within other framing
protocols is not defined at this time.
Author: Alfred E. Heggestad
Change controller:
IETF Audio/Video Transport working group delegated from the IESG.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. SDP Usage of Speex</span>
The information carried in the media type specification has a
specific mapping to fields in the Session Description Protocol (SDP)
[<a href="./rfc4566" title=""SDP: Session Description Protocol"">RFC4566</a>], which is commonly used to describe RTP sessions. When SDP
is used to specify sessions employing the Speex codec, the mapping is
as follows:
o The media type ("audio") goes in SDP "m=" as the media name.
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 The parameters "ptime" and "maxptime" go in the SDP "a=ptime" and
"a=maxptime" attributes, respectively.
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.
<span class="grey">Herlein, et al. Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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 [<a href="#ref-SPEEX" title=""The Speex Codec Manual"">SPEEX</a>]) is included as an indication.
+------+---------------+-------------+
| 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
+------+---------------+-------------------+------------------------+
| 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
The Speex parameters indicate the decoding capabilities of the agent,
and what the agent prefers to receive.
The Speex parameters in an SDP Offer/Answer exchange are completely
orthogonal, and there is no relationship between the SDP Offer and
the Answer.
<span class="grey">Herlein, et al. Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
Several Speex specific parameters can be given in a single a=fmtp
line provided that they are separated by a semicolon:
a=fmtp:97 mode="1,any";vbr=on
Some example SDP session descriptions utilizing Speex encodings
follow.
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Example Supporting All Modes, Prefer Mode 4</span>
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:
m=audio 8088 RTP/AVP 97
a=rtpmap:97 speex/8000
a=fmtp:97 mode="4,any"
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Example Supporting Only Modes 3 and 5</span>
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.
m=audio 8088 RTP/AVP 97
a=rtmap:97 speex/8000
a=fmtp:97 mode="3,5"
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. Example with Variable Bit-Rate and Comfort Noise</span>
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
<span class="grey">Herlein, et al. Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a>. Example with Voice Activity Detection</span>
The offerer indicates that it wishes to use silence suppression. In
this case, the vbr=vad parameter will be used:
m=audio 8088 RTP/AVP 97
a=rtmap:97 speex/8000
a=fmtp:97 vbr=vad
<span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a>. Example with Multiple Sampling Rates</span>
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.
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"
<span class="h3"><a class="selflink" id="section-5.6" href="#section-5.6">5.6</a>. Example with Ptime and Multiple Speex Frames</span>
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.
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.
In the example below, the ptime value is set to 40, indicating that
there are two frames in each packet.
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.
<span class="grey">Herlein, et al. Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
Care must be taken when setting the value of ptime so that the RTP
packet size does not exceed the path MTU.
<span class="h3"><a class="selflink" id="section-5.7" href="#section-5.7">5.7</a>. Example with Complete Offer/Answer Exchange</span>
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.
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.
m=audio 8088 RTP/AVP 99
a=rtmap:99 speex/8000
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Implementation Guidelines</span>
Implementations that support Speex are responsible for correctly
decoding incoming Speex frames.
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.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
RTP packets using the payload format defined in this specification
are subject to the security considerations discussed in the RTP
specification [<a href="./rfc3550" title=""RTP: A Transport Protocol for Real-Time Applications"">RFC3550</a>], 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.
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.
<span class="grey">Herlein, et al. Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
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.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgments</span>
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.
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.
Thanks to former authors of this document; Simon Morlat, Roger
Hardiman, and Phil Kerr.
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. References</span>
<span class="h3"><a class="selflink" id="section-9.1" href="#section-9.1">9.1</a>. Normative References</span>
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC3550">RFC3550</a>] Schulzrinne, H., Casner, S., Frederick, R., and V.
Jacobson, "RTP: A Transport Protocol for Real-Time
Applications", STD 64, <a href="./rfc3550">RFC 3550</a>, July 2003.
[<a id="ref-RFC4566">RFC4566</a>] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session
Description Protocol", <a href="./rfc4566">RFC 4566</a>, July 2006.
<span class="h3"><a class="selflink" id="section-9.2" href="#section-9.2">9.2</a>. Informative References</span>
[<a id="ref-CELP">CELP</a>] 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, <<a href="http://www.ntis.gov/">http://www.ntis.gov/</a>>.
[<a id="ref-RFC4288">RFC4288</a>] Freed, N. and J. Klensin, "Media Type Specifications and
Registration Procedures", <a href="https://www.rfc-editor.org/bcp/bcp13">BCP 13</a>, <a href="./rfc4288">RFC 4288</a>, December 2005.
<span class="grey">Herlein, et al. Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc5574">RFC 5574</a> Speex June 2009</span>
[<a id="ref-SPEEX">SPEEX</a>] Valin, J., "The Speex Codec Manual",
<<a href="http://www.speex.org/docs/">http://www.speex.org/docs/</a>>.
Authors' Addresses
Greg Herlein
Independent
2034 Filbert Street
San Francisco, California 94123
United States
EMail: gherlein@herlein.com
Jean-Marc Valin
Xiph.Org Foundation
EMail: jean-marc.valin@usherbrooke.ca
Alfred E. Heggestad
Creytiv.com
Biskop J. Nilssonsgt. 20a
Oslo 0659
Norway
EMail: aeh@db.org
Aymeric Moizard
Antisip
5 Place Benoit Crepu
Lyon, 69005
France
EMail: jack@atosc.org
Herlein, et al. Standards Track [Page 14]
</pre>
|