Convert WAV file for use with Asterisk greetings/IVR

April 29th, 2010

If file1.wav is any WAV file, then executing this command: sox file1.wav -r 8000 -c 1 -s file2.wav resample -ql you will get Asterisk playable WAV file: file2.wav.

sox is a free download from http://sox.sourceforge.net/ for Windows, Mac OS X and Linux.

The “resample” option is deprecated in the most recent version of sox (v14.3.1), but still works and only throws up a warning.

I use the following script to convert a batch of files:

mkdir new
for I in $(ls -1 *.wav)
do
NAME=$I
echo “Converting $NAME”
sox $NAME -r 8000 -c 1 -s new/$NAME resample -ql
echo “Output filename: new/$NAME”
done

Posted in Tech Stuff | Comments (0)

Leave a Reply

You must be logged in to post a comment.

Recent Posts