Home > Useful > Converting WMA files to MP3

Converting WMA files to MP3

September 4th, 2009 brett Leave a comment Go to comments

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
done
 

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!

Related posts:

  1. Using gpg to encrypt files on a web server
  2. Emacs and Ruby on Rails

Categories: Useful Tags: , , , , , ,
  1. No comments yet.
  1. No trackbacks yet.