[asterisk-users] Converting MP3 files to wav for Asterisk

Timothy Smith timotsmith at gmail.com
Wed Mar 2 23:20:27 CST 2011


Hi,

I am running a service where I play full songs but MP3 files kept on
crashing my server. I resorted to wav but the quality is really poor
after converting..or even sometimes not audible at all! Do you guys
know of a better way I can convert mp3 to wav and restore quality?
Below is the script I am using, I also  tried the steps at
http://www.voip-info.org/wiki/view/Convert+WAV+audio+files+for+use+in+Asterisk
but it wasnt any better.

----------------------------
#!/bin/bash
for i in `ls $1/*mp3`
do
lame -a $i $i.wav
mplayer   -quiet  -vo null  -vc dummy  -ao pcm:waveheader:file="$i.h.wav" $i.wav
sox $i.h.wav -t raw -r 8000 -s -2 -c 1 `echo $i|sed "s/.mp3/.sln/"`
done
-----------------------------

Any thoughts please?

Regards,
Tim



More information about the asterisk-users mailing list