Batch convert Asterisk GSM WAV files to mp3
I am working on a fun project at work to provide web based visual voice-mail for a ticketing system. I realized Flash audio players are not able to play WAV files so had to work around that. Since users are also using voicemail files in other ways I can't just change the output format from Asterisk. The type of file that I'm working with is identifed with file ms0012.WAV
as: msg0012.WAV: RIFF (little-endian) data, WAVE audio, GSM 6.10, mono 8000 Hz
First I'll say that I found this post http://www.thiscoolsite.com/?p=73 but like some of the commenters I couldn't get the script to work. The author assumes some other format than Asterisk spits out by default. Lame would complain that Unsupported data format: 0x0031
The Tools
Sox: http://sox.sourceforge.net/
Lame: http://lame.sourceforge.net/
So here's what I do:
Convert GSM encoded wav to Microsoft PCM
sox msg0012.WAV -s msg0012.wav
Convert the PCM wav to mp3:
lame msg0012.wav msg0012.mp3
And here's a script to do this as a batch:
Comments
a big help
Here is online free mp3 to wav converter
convert mp3 to wav