System information

CentOS Prerequisite
Since CentOS does not have MP3 capability installed with sox, you will have to install
mpg123 before you can convert MP3 files for use with Asterisk.
First you will need to install the rpmforge repository. To find out which version you
need, open your web browser and go to http://dag.wieers.com/rpm/FAQ.php#B. Select
the text for the version/architecture you want to install and paste it into your shell:
$ rpm -Uhv http://apt.sw.be/redhat ...
You need to make sure this new repository is used correctly, so run the following:
$ yum install yum-priorities
(If you want to know more about yum priorities, see this site: http://wiki.centos.org/
PackageManagement/Yum/Priorities.)
Once the repository has been added, you can proceed to get mpg123:
$ yum install mpg123
Once that’s done, your CentOS system is ready to convert MP3 files for use with
Asterisk.
If you are familiar with the file formats and have some experience working with audio
engineering software such as Audacity, you can convert the files on your PC and upload
them to Asterisk. We find it is simpler to upload the source MP3 files to the Asterisk
server (say, to the /tmp folder), and then convert them from the command line.
To convert your MP3 files to a format that Asterisk understands, you need to run the
commands outlined here (in this example we are using a file named SilentCity.mp3).
CentOS
First, convert the MP3 file to a WAV file:
$ mpg123 -w SilentCity.wav SilentCity.mp3
Then, downsample the resulting WAV file to a sampling rate that Asterisk understands:
$ sox SilentCity.wav -t raw -r 8000 -s -w -c 1 SilentCity.sln
Ubuntu
If you have not done so already, install sox, and the libsox-fmt-all package:
# sudo apt-get install sox libsox-fmt-all
Then, convert your MP3 file directly to the uncompressed SLN format:
$ sox SilentCity.mp3 -t raw -r 8000 -s -w -c 1 SilentCity.sln
80 | Chapter 4:Initial Configuration Tasks