5.16. Playing MP3 Sound Files on Asterisk

You want to use music on hold in MP3 format, rather than WAVE or GSM. But, they don't work—how do you make them go?

Download the asterisk-addons package to get Asterisk's format_mp3 player. Follow the instructions in the /usr/src/asterisk-addons-1.4.[version]/format_mp3/README to install format_mp3.

Now, your MP3 files will play just fine.

MP3 files eat more CPU cycles than WAVE or GSM, so don't use them on marginal systems. MP3 files can easily be converted to WAVE format with lame:

	$ lame --decode musicfile.mp3 musicfile.wav

Do this to batch-convert all the MP3 files in the current directory:

	$ for i in *.mp3; do lame --decode $i 'basename $i .mp3'.wav; done