getting the hourly news in mp3 format

Recipe for downloading the five-minute top of the hour news stream from NPR and converting it into mp3 format. Relies upon mimms, vlc, and lame. I had to use mimms because vlc won’t terminate upon reaching the end of an mms stream. I’m using lame’s phone preset, but you may find --preset voice to sound a little better. The hard part was getting VLC to output WAV format audio in faster than realtime. Unfortunately, NPR won’t stream the audio much faster than realtime, so the script takes about five minutes to run.

On OSX, you’ll want the path /Applications/VLC.app/Contents/MacOS/clivlc instead of just vlc.


#!/bin/sh
mimms -o /tmp/news.asf "mms://216.35.221.84/newscast/newscast.wma" 
vlc -I dummy /tmp/news.asf \
  :sout='#transcode{acodec=s16l}:std{access=file,mux=wav,url=/tmp/news.wav}' \
  vlc:quit
lame -S --preset phone /tmp/news.wav /tmp/news.mp3
rm /tmp/news.wav /tmp/news.asf

Coming soon, an AppleScript that will pause iTunes at or near the top of each hour and play this (or another) mp3.

3 Responses to “getting the hourly news in mp3 format”

  1. Erik says:

    Now you just need Robert, Michele, or Melissa to add “on mp3″ after they say their names at the start the evening ATC newsbreaks. Call up NPR HQ in DC to get them on that.

    Also, it should stop itunes at 10pm to play an mp3 of “Do you know where your girlfriend is?”

    Short answer: she’s with me; booyah kasha!

  2. Debasish says:

    Please send me updates of your services.

  3. […] 3/8/2005 a thousand monkeys Remember my recipe for downloading NPR news in MP3 format? Someone else has picked up that ball and is r […]

Staypressed theme by Themocracy