Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Overview

As a part of the Media Overhaul project for Asterisk 1.10, changes have been made to Asterisk to increase the number of codecs it's capable of supporting, to handle codecs with custom formats, and to support audio sampling rates greater than 16kHz. This has resulted in several practical changes to Asterisk that will benefit its users.

Expanded Signed Linear Support

Versions of Asterisk prior to 1.10 supported 16-bit Signed Linear sampled at 8kHz and at 16kHz (versions 1.6.0-1.8). New to Asterisk 1.10 is support for a much wider range of sampling rates. Asterisk can resample between any of these sampling rates and can read/write raw 16-bit signed linear audio files from/to disk. The complete list of supported sampling rates and file format extensions is:

Sampling Rate

Asterisk File format

8kHz

.sln

12kHz

.sln12

16kHz

.sln16

24kHz

.sln24

32kHz

.sln32

44.1kHz

.sln44

48kHz

.sln48

96kHz

.sln96

192kHz

.sln192

Asterisk 1.10 removes the format_sln16 file format in favor of expanded support in the main format_sln file format for all sampling rates. So, users who notice the absence of format_sln16 from their Asterisk 1.10 builds should not panic.

Users can create 16-bit Signed Linear files of varying sampling rates from WAV files using the sox command-line audio utility.

  • SOX example
sox input.wav -t raw -b 16 -r 32000 output.sln
mv output.sln output.sln32

In this example, an input WAV file has been converted to RAW Signed Linear at a depth of 16-bits and at a rate of 32kHz. The resulting output.sln file is then renamed output.sln32 so that it can be processed correctly by Asterisk.

32kHz Speex Support

Asterisk versions prior to 1.8 supported 8kHz Speex. Asterisk 1.8 supports 8 and 16kHz Speex. Asterisk 1.10 now supports 8, 16, and 32kHz Speex. Use of the 32kHz Speex mode is, like the other modes, controlled in the respective channel driver's configuration file, e.g. chan_sip's sip.conf.

  • Speex Example

sip.conf

[mypeer]
type=peer
secret=mysupersecret!!!
host=dynamic
context=fancycalls
disallow=all
allow=speex

[mypeer2]
type=peer
secret=myothers3cr3t
host=dynamic
context=fancycalls
disallow=all
allow=speex16

[mypeer3]
type=peer
secret=passwordisaterriblepassword
host=dynamic
context=fancycalls
disallow=all
allow=speex32

In this example, we have created three SIP peers for 3 different devices. The first, mypeer, supports only the 8kHz sampling of Speex; the second, mypeer2, supports only the 16kHz sampling of Speex; and the third, mypeer3, supports the new 32kHz sampling of Speex.

For comparison, here are some Speex samples, saved as WAV files for easy-of-playback.

8kHz

16kHz

32kHz

  • No labels