We have used Vonage as our phone provider for almost a year now and have loved the service. One of the many features they add at no extra charge is the ability to have all voicemail messages sent as an email attachment. Unfortunately, they only send these attachments in WAV format, which means they take up a ton of room.
I like to store all voicemails I receive in case I need them later, and so I was looking for a way to shrink those emails down. I found this post describing how to do just that using Perl and LAME to convert the attachments to MP3.
Unfortunately, that script didn’t work quite right for me. I have cleaned it up a bit and posted it here for anyone interested.
[UPDATE] 2006.05.14: Towards the end of 2005, Vonage changed the format of their WAV file attachments to use an encoding called “CCITT u-Law” which LAME doesn’t understand. See my new post for a method using SOX instead.

Strict
March 14th, 2005 at 4:24 pm
Hey, I updated my script, removing the ugly/dangerous temp file use by using IPC::Open2 instead. File is availabel from http://www.hughes-family.or... — I fixed the formatting on my blog too. Some idiot had turned on Markdown processing, which really goes to town on Perl syntax.
March 22nd, 2005 at 4:47 pm
Thanks for the update Craig! Unfortunately, as I mention above I was unable to get IPC::Open2 to work correctly. I have updated the script to use a bit more distinctive of a tempfile name, though. This can also easily be modified to use some other directory besides /tmp which only the MTA has read/write privileges to if necessary.
November 16th, 2005 at 5:12 pm
I’ve figured out the sox foo to get things working with the new WAV format. Check http://www.hughes-family.or...
August 22nd, 2006 at 10:52 pm
CCITT u-Law is optimized for voice and heavily compresses (with minimal loss of quality) a typical voicemail message.
There really isn’t much need to convert it to mp3.