Bit-scraping Car Talk

dws on 2005-01-31T09:53:39

One of the high points of the weekend used to be listening to Car Talk while driving. My travel pattern has changed since moving, and I almost always miss the show now. I had rigged up an FM-radio to audio-in connection to let me capture .wav files to burn to CD, but this never seemed to work out quite right, and that was back before I had a USB MP3 player.

Car Talk keeps the most recent show available as a RealAudio feed. Bits. Hm...

Hypothetically, then, and with the help of a co-worker who knows the sekret of getting mplayer installed on Linux (configure yum to point to freshrpms.net, import their PGP key, use yum to install mplayer, and then figure out how to download and install the essential codecs), one could threw together a script that scrapes the Car Talk site for links to the ReadAudio files, streams them disk, converts them from .rm to .wav, and finally (via lame) to an .mp3 in a Samba directory named for the week. From there, it would be a quick copy into an MP3 player, and from there to a happier commute.

It would be a slow process (the RealAudio feed seems to be throttled), but that's what a 2 AM cron job is for. The basic incantation for ripping a segment of the show would probably look something like

$rtsp = ... link to real audio stream ...
mplayer -noframedrop -dumpfile tmp.rm \
 -dumpstream  $rtsp
mplayer -ao pcm -aofile tmp.wav -vo \
 -null -vc dummy --playlist tmp.rm
lame -h -b 128 tmp.wav segment$n.mp3

I'd be surpised if this same recipe didn't apply to lots of interesting feeds.


Car Talk in Real...?

ajt on 2005-01-31T11:29:03

Last time I checked Car Talk had stopped Real downloads, I'm glad they are back.

When I wanted to record Hitch Hikers from the Beeb, I used Realplayer and the vsound tool to get wav output that I then converted to Ogg Vorbis. I use Debian, so you just apt-get the right bits and it all works, YMMV.

State of the art in Linux audio

jdavidb on 2005-01-31T18:57:56

Do I understand correctly that mplayer can a) play RealAudio files and b) convert those files to .wav format? I haven't looked in a long time, but the last time I checked RA was a proprietary format I couldn't possibly hope to use with free software. I knew they had opened a lot of their code, but I thought the codec was still proprietary.

Re:State of the art in Linux audio

dws on 2005-01-31T19:12:21

Yes and yes (and maybe yes). http://www.mplayerhq.hu/homepage/design7/news.html answers nearly all questions.

Scraping.

TorgoX on 2005-02-01T03:36:13

You'd think NPR et al would just stop being such dicks, and put up the mp3s to download.

But alas, in the meantime, there is always the scraping.