The first thing you want to do when converting audio files is to convert them into .wav files. Mplayer can dump almost anything that it plays (and it can play almost anything) to raw .wav format.mplayer -quiet -vo null -vc dummy -ao:pcmheader:file=".wav file" "inputfile"

To mp3 :

Lame is a command-line tool which can convert .wav to .mp3lame input.wav output.mp3