Formatting WAV files for use in Asterisk

Formatting WAV files for use in Asterisk


In order for Asterisk to use your WAV files they must be sampled at 8khz. You can easily resample your wav files in Linux with a utility called sox.


Installing Sox:

To install in RedHat based distros like CentOS, SuSe, Fedora etc...
yum -y install sox
For Debian based distros like Debian, Ubuntu etc...
apt-get install sox

Running Sox:

After you install sox you may use the following command to resample your files. You will want to change infile and outfile to your file names.

sox infile.wav -c 1 -r 8000 outfile.wav

Prevention Tips

If possible you should set the software that is creating your file to sample at 8khz

Applies To

Asterisk all versions.


Asterisk, Sox, WAV, IVR, SOUND, MOH, Music on Hold

 Login [Lost Password] 
Remember Me:
 Article Options