Here is a short BASH script for quickly and easily converting WMA files to MP3.

As background, WMA and MP3 are container formats. Therefor, we first use mPlayer to extract the WAV audio content from he WMA file. Then we use lame to encode the WAV audio to mp3 format. The lame encoder has the added benefit of inserting the encoded audio into a proper MP3 file format
Here is the BASH script to convert WMA to MP3 audio formats.
#!/bin/bash
current_directory=$( pwd )
#remove spaces
for i in *.wma; do mv “$i” `echo $i | tr ‘ ‘ ‘_’`; done
#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv “$i” `echo $i | tr ‘[A-Z]‘ ‘[a-z]‘`; done
#Rip with Mplayer / encode with LAME
for i in *.wma ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm -waveheader $i && lame -m s audiodump.wav -o $i; done
#convert file names
for i in *.wma; do mv “$i” “`basename “$i” .wma`.mp3″; done
rm audiodump.wav
Unfortunately, this process does not preserve any meta-information.
Here is a ruby script I wrote to do just that. It’s very basic and only writes v.1 tags. For v.2 tags use id3lib-ruby.
#!/usr/bin/ruby
require ‘wmainfo’
song = WmaInfo.new(ARGV[0])
mp3song = ARGV[0].gsub(/\.wma/,”.mp3″)
# Print what we found & make the mp3 tags
system(“mp3info”, “-a”, song.tags["AlbumArtist"], mp3song)
system(“mp3info”, “-g”, song.tags["Genre"] , mp3song)
system(“mp3info”, “-l”, song.tags["AlbumTitle"] , mp3song)
system(“mp3info”, “-y”, song.tags["Year"] , mp3song)
system(“mp3info”, “-n”, song.tags["TrackNumber"].to_s, mp3song)
system(“mp3info”, “-t”, song.tags["Title"] , mp3song)
References: