I’ve been using free Windows utilities for months now to record some of my favorite online radio shows—ones that aren’t available as podcasts. I had previously used Total Recorder, but the solution I’ll explain below uses only free software and does the recording in the background, so you’re free to record multiple shows at once or listen to other things while recording.
Download the Necessary Utilities
Start by downloading the following four programs:
close into a directory that is in your path. With the files in the path, you can reference them in batch files without having to specify a directory every time. You can either use a directory that is already in the path, such as
c:\winnt, or set aside a new directory specifically for such tools. I usually create a directory called
c:\bin and add that to the path.
Wget the Playlist File
You will need to create a file that specifies where to find a given station’s stream. In a browser, open the web site for a station you’d like to record. Right click on the playlist link (often called “listen”) and choosed “Copy Link Location” or “Copy Shortcut.”
Choose a directory where you’d like to store the recorded files, such as
c:\radio. Create a subdirectory called
\stations to store the playlist files for each station. From that directory, use wget to download a copy of the playlist file, using the URL copied above.
I then rename the playlist to something more meaningful.
ren mp3.m3u wbez.txt
Note: You may be able to specify the stream directly on the mplayer command line, but I have read of possible problems using that method.
The Recording Script
Save the following text to a .bat or .cmd file in the same directory where you’d like to store your recorded audio. I named mine
for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set DATEFORMATTED=%%k%%i%%j
start "%2" /min c:\etc\mplayer\mplayer -playlist .\stations\%1 -dumpstream -dumpfile %2%DATEFORMATTED%.mp3 -vc dummy -vo null
set /a SECONDS=%3 * 60
You may need to adjust the second line of the script to reference the correct
stations directories you created above.
Schedule the Script
Open the Scheduled Tasks utility (Start | Programs | Accessories | System Tools | Schedules Tasks). Choose File | New | Scheduled Task to create a new task. Selec tthe Schedule tab and specify a start time and the appropriate day (or days) you want the recording to run. Next, select the Task tab and enter a command on the “Run:” line, similar to the following:
c:\radio\recordradio.cmd station.txt ShowName #Minutes
The arguments after the command file specify the playlist file, name for the output file, and the number of minutes to record. For instance, you might use the following to record WBEZ, to capture “This American Life” for 60 minutes.
c:\radio\recordradio.cmd wbez.txt ThisAmericanLife 60
Test the Scheduled Task
Verify that the scheduled task will record properly by right-clicking the task and selecting “Run.” This will open two command line windows, one running the script and another running the recording process. Let the recording run for 30 seconds or so, then hit the space bar in the script window to cancel the wait command and end the recording.
You should then see a new file in the
\radio directory, such as
ThisAmericanLife20060724.mp3. The numbers represent the date the program was recorded, formatted for easier sorting.
This may seem like a hassle the first time you set it up, but adding additional shows is much easier once you’re passed the initial configuration. To find shows to record, check out my article on finding the best of online radio. Some of my favorites include Fresh Air, This American Life, and Solid Steel Radio.
For the best results, sync your computer with a time server to ensure consistent start and stop times. You may want to add a minute or two to the start and end of each recording to allow for shows that don’t start exactly on time.
Bandwidth costs for radio stations can be expensive. Consider donating to the stations you listen to regularly.
I realize that it’s not the most elegant solution, so I’d love to hear suggestions for possible improvements. Feel free to leave comments. And check back here soon, I’ll be posting another script in a few days that records and converts Windows Media and RealAudio streams.