Sunday, May 10, 2009

Converting between WAV and MP3 with simple open source tools

Abstract

A short memo on converting between mp3 and wav files

Today I find some conf call audio records are so big for my little hard disk so I decided to convert them from WAV to MP3 format. I make use of a simple (more precisely, simple to use) tools to do the job -- lame.

Since all my wav files to convert sit in the same folder, I make use of a little bash:

$ for f in `ls -1 *.wav | sed s/\.wav$//` ; do lame $f.wav $f.mp3 ; rm -v $f.wav ; done

Easy, isn't it?

Converting mp3 files back is just as easy, though there should be some quarlity loss which I don't believe can be noticed for a conf call record;) The mpg123 is as simple as its name 123, you just have to give it the name of the file to convert

$ for f in `ls -1 *.mp3 | sed s/\.mp3$//` ; do mpg123 -w $f.wav $f.mp3 ; done

No comments:

Post a Comment