I wanted to record a couple of radio shows so that I can listen to them later on my linux machine. Basically I would like to listen to a mix of realplayer, Windows Media, Ogg and MP3 streams and save them as mp3 or ogg files so I can listen to them later on my computer or iriver ogg/mp3 player.
First I tried mplayer's dumpstream command
1) mplayer -dumpfile cores -dumpstream http://wm.warnermusic.com/France/the_corrs/summer_sunshine/video/Summer_Sunshine_video_458.wmv
(this will give you a file called “cores” in your home-directory)
2) mplayer -vo null -vc null -ao pcm -aofile audio.wav cores
(this will convert the videofile to a wav audiofile)
3) lame audio.wav cores.mp3
(this will convert the file from wav to mp3)
However this process core dumped on realplayer recorder over 10 minutes. Also it doesn't know about ram files so you have to download them first (wget filename) and then open them to file the real link to the rm file. So I went on to look for some other tools.
Most of the tools seem to be wrappers around vsound and/or sox and lame/oggenc. Another tool I looked at is streamripper, which works for mp3 or ogg streams.
First I grabbed realcap which is a shell script front end to those tools. Downloaded, compiled and installed vsound.
Trick one - you have to ensure that realplayer is using OSS drivers
http://www.osl.iu.edu/~tveldhui/radio/
After that seemed to work I tried directly with vsound. vsound acts as a kind of virtual audio loopback cable ... it allows you to record the output audio stream of ... and line out jacks on the sound card.
vsound --timing -f myfile.wav realplay http://www.radio.org/ra/show.ram
oggenc myfile.wav
I also checked out the trplayer - which is a command line wrapper to realplayer. http://www.linux-speakup.org/trplayer.html.
Got the error:
Failed to load rmacore.so.6.0: /usr/lib/RealPlayer8/Common/rmacore.so.6.0: Cannot open shared object file: No such file or directory
Well I figured out that they must be looking for the real player in /usr/lib when it was in /usr/local/ so I copied the directories over to where it wanted to find them and everything worked ok.
Also I tried out streamripper
http://streamripper.sourceforge.net/, which seemed to work fine ripping various streams. It didn't seem to be able to read the .m3u file so I had to download the m3u file with wget and look at it and then use streamripper http://url.ogg for it to work. Cool - now I can listen to the BBC and CBC and ABC (Australian Broadcasting) and Netherlands Broadcasting when I want to and where I want to.
Finally I had a look at mp3record - a bash shell wrapper for lame and sox
Basically it does this:
(sox -r $strFreqRate -t ossdsp -w -s /dev/dsp -t raw -c 2 -
| lame -s 44.1 -x -b $strBitRate -m s - $strFileName) &
Things to get working...
1) streaming directly to ogg with no intermediary wav step.
2) see if I can get this running from a cron job...
Whats left?
Posted by Anthony at November 25, 2004 03:24 PM | TrackBack