Converting WMA files to MP3

I recently needed to convert a bunch of WMA files to MP3 on my macbook. The easiest way to do it was to open up a terminal window, change directory to the directory with the files, and then use mplayer to convert each file to a WAV, and then sox to convert the file to an MP3. The command line I used is described below:

for i in *.wma ; do 
  MN=`basename "$i" .wma`.mp3
  mplayer -vo null -vc null -af resample=44100 -ao pcm:waveheader "$i"
  sox audiodump.wav "${MN}"
  rm audiodump.wav

I probably can just output straight to MP3 from mplayer, but I couldn’t be bothered reading through the mplayer man page to work out how to do it!

One Reply to “Converting WMA files to MP3”

  1. This was a most excellent post! I wanted to add the whole Abbey Road B-side to a shuffled playlist so that it would play contiguously (as it should!), but only had the separate tracks as .wmas from when I’d ripped my own CDs 12 years ago. Used this to convert to mp3 then sox to concatentate them all together into one file. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *