Portable Timeshifted Radio

I’m trying an experiment with tying together pieces of things I already have. With RadioLover and my beloved iRiver SlimX, it occurred to me that I can take the radio shows I’m already capturing, burn them to a CD in MP3 format, and then carry them around and listen to them whenever I want. It takes the TiVo style interaction with the streaming MP3s one step farther, by breaking the requirement for the computer. I’m not sure why I didn’t think of this earlier, but at least it finally did. I like that thought that I can define the radio shows I want to hear, have them automatically captured for me, burned, and then in a form that I can listen to them whenever and wherever I choose.

Today I added a few shows that I want to hear every week and hunted up a few new streams. PublicRadioFan was instrumental in this process, as I look up what stations carry my programs and when. Looking around for a good Prairie Home Companion replay, I ran across WHQR in Wilmington NC (a town I have been lobbying to live in for a while now), one of the few 128 Kbps MP3 feeds I have found (WREK and WUGA in Georgia are the only others ones I have configured.) It’s an interesting process, and you really have to listen to every stream before you decide to use it. For example, while KNAU in Flagstaff AZ on paper has a 96 K feed, as I check it out now it is unlistenable. You hear this tiny bit of signal, which I first though was it being turned too low. However, when a bit of music came on it sounded fine, it’s just the voices that aren’t audible. That makes me suspect that they have screwed up their inputs and are out of phase as they put their stereo airsignal into the mono feed – essentially subtracting the two channels and broadcasting the difference. MP3 feed quality definitely seems to vary wildly.

I might actually choose to capture some things in lower quality feeds, nonmusic programs like Car Talk, where sound quality is not the highest priority. If I can fit all of a weeks shows on one CD, then I won’t worry about it. If it’s way more than can fit on one, I’ll just burn 2 per week. If it’s just barely over the one CD capacity, I might think about going with lower quality feeds for some shows.

I like RadioLover, but it is not the most rock solid program I’ve ever seen. Given its role as the thing that always runs and records shows for you, when it crashes while you are out of town (like it did for me over XMas) it can be distressing. I missed a week of stuff that way. To fix that, I just added a Perl keep alive script. If you want to do this on your box, here are step by step directions:

  1. Create a file with these contents:
    –Cut below this line–

    #!/usr/bin/perl
    
    $app = '/Applications/RadioLover.app/Contents/MacOS/RadioLover';
    
    $ps = `ps -auxwww`;
    
    #print "results of ps = $ps\n";
    
    if ($ps !~ /$app/) {
        print "app not running, so starting it\n";
        exec($app . "&");
    } else {
        print "app was already running. Doing nothing\n";
    }

    –Cut above this line–
    Make sure that the #! are the first two characters of your file, no whitespace ahead of them, or it won’t work. Save this to your home directory, call it whatever you like but for the directions I’m calling it start-radiolover.pl .

  2. Open a terminal window, and execute this command:
    chmod +x start-radiolover.pl
    

    Test if it is working by executing this command:

    ./start-radiolover.pl
    

    If RadioLover is running, you should get the message that it is already running. If it isn’t, it should pop up and start running.

  3. In the terminal window, execute the command

    crontab -e
    

    If you aren’t a Unix jocky used to vi, before you do that execute this comand in the terminal window:

    export EDITOR=/Applications/TextEdit.app/Contents/MacOS/TextEdit 
    

    If you made your editor TextEdit, after editing the file you’ll have to close down the whole program. Now, add this line to the file, at the end if there is stuff in there or as the only line otherwise:

    59 * * * * /Users/[your username]/start-radiolover.pl
    

    Voila! Every hour at 1 minute to the top of the hour, this will make sure your RadioLover is running. Never miss a show again! I love the Unix underpinnings of MacOS X!

2 Replies to “Portable Timeshifted Radio”

  1. thanks for the tip man. I am glad you have step by step instructions too beacause you know I would be asking you about it.

  2. NP, dude. You’re the only other person I know that uses RL anyway. That script could be used for any program that you want to verify it is running just as easily. Rewrite the variable to point at some other program and it will work. If you changed that line to = shift; you could even pass in the program as a command line parameter. Either way, you’d have to fully qualify the path to it, with all the crazy OS X stuff until you get down to the root executable application.

Comments are closed.