How to convert wma's into mp3's on a Mac
in command line
It took me a while to figure out how to automatically convert wma files into mp3's on Mac OS, so I thought it might be useful to write down all the steps somewhere.
Here's a list of ingredients that you'll need:
Below I describe how to get the above three ingredients.
- mplayer – a command line audio (and video) player
- lame – a command line audio encoder for Mp3's
- root privileges in order to install the above programs
- make-mp3 – a handy script which puts together the two above programs. It can be used to recursively traverse directories and replace wma's by mp3's.
This is more complicated than it might seem. Warning! MPlayerOSX is a different thing, it doesn't work in the command line.
To install mplayer:
- Register as an Apple developer here.
- Download and install Xcode Developer Tools from the Mac Dev Center. Be careful to download the version matching your operating system version.
- Download and install MacPorts from a disk image.
- Install mplayer: in the command line type sudo port install mplayer
This is much simpler than the previous step.
Download and install lame from here.
Download the make-mp3 script
On this forum I found a script written by Bernhard Hartleb.
I modified it slightly because the original version didn't work well on Mac OS. Download the modified script from here.
In the command line, go to the folder containing the script and change its mode to excecutable, by typing chmod a+x make-mp3.
Type ./make-mp3 -h to see the options of the script.
To recursively replace all wma's into mp3's in some directory dir and remove the originals, type
./make-mp3 -r -d -D dir
Created: Thu May 20 9:53:30 MEST 2010