Converting Audio to PCM Wave format



To make sure you’ve go the idea that mplayer is really a swiss army knife for media files that can do most anything. I wanted to get a post JUST on this idea. Any media format that mplayer recognizes it can dump the audio to the most common and readable audio format out there, the PCM Wav file.

Here’s how it goes:

Usually this is just an intermediary step en route to another file format (mp3 for instance..)

Here’s a line I’ve used from a script of mine:

mplayer -ao pcm:file=$1_$date.wav $1.rm

so… this calls mplayer and gives the audio output driver as the pcm output driver and the filename you can see I’ve controlled with the command switch again. In this case I was converting from a .rm file to the wave format. Unfortunately the rm file was not named descriptively enough for my taste, so I’ve added a variable that tags the date to the filename as well.

So… let’s say you run converttowav myaudio

Then mplayer will take the source of myaudio.rm and give you myaudio_todaysdate.wav in the nice compatible (and easily convertable) wav format.

   Send article as PDF   

Similar Posts