Extract Audio from Video Files to WAV using Mplayer
You can extract the audio from a video file using mplayer and save the result to a WAV file, which you can then manipulate to your hearts content. For example, you may want to compress the audio to a stereo MP3 or OGG.
The following command instruct that the audio output (-ao) should be redirected out to a PCM WAV file as fast as possible, while suppressing all video output.
mplayer -ao pcm:fast:file=audio.wav -vo null -vc null video.avi
Convert the resulting WAV to MP3. The following is a great way to convert your WAV files to a high quality Variable Bitrate MP3. See the man page for a decent tutorial on the available options.
lame -V0 -q0 --vbr-new audio.wav audio.mp3