Search This Blog

Sunday 31 January 2010

Real Audio to MP3

Taken from here

Download the Audio Stream into a File

The easiest way to convert Real Audio streams to MP3 format is via MPlayer, the incredibly wonderfully marvelous multimedia player for Linux. If you install it correctly, i.e. with the correct Real Audio libraries, the process is as simple as:

mplayer -playlist file.ram -ao pcm -aofile file.wav -vc dummy -vo null

where file.ram is the file containing the actual URL of the Real Audio file. An example URL from the always interesting New Sounds radio show is:

pnm://66.150.15.101:7070/realimpact/wnyc/rans/newsounds2073.ra?cloakport=80,554,7070

You can usually obtain the files containing the URLs by shift clicking on the desired Real Audio stream file rather than just clicking on it. This will allow you to save the URL to a file that will replace the file.ram placeholder file in the mplayer command. It's a good idea to replace file in the string file.wav with the same thing you used to replace it in file.ram. And by the way, there's nothing sacred about the ram suffix. You can use any file name you want for the URL file, with or without a suffix. It's a good idea, though, to retain the wav suffix since it's a WAV file you're going to create and that's a standard suffix for such things.

Converting to MP3

Once you've obtained your desired URL file and run the above command, mplayer will download the Real Audio file in real time, i.e. if the Real Audio file is an hour long it will take an hour, and convert it on the fly into WAV format. After the file's been completely downloaded - and these can get pretty big, e.g. 600 or more megabytes for a hour-long show - you can convert the WAV file to an MP3 file via the usual procedure, e.g.

lame file.wav file.mp3

It's just that easy.