Monday, July 9, 2007

Scheduled Recordings with Spectravue

I love using my new SDR-IQ radio to record 190 kHz of spectrum. But, the program that controls the radio (SpectraVue) only accommodates a single event recorder which can repeat once per day. I like to do repeated top-of-the-hour recordings during the night while I sleep (from, say :58 to :02) to review for IDs later in the day. Until the author of SpectraVue adds that capability, or others add the feature via a separate application, I needed another way to do it.

Once SpectraVue is running and configured to record, pressing the "start" (F12) key starts the recording and automatically saves the resultant data into a uniquely-named file. Pressing the "stop" (F10) key stops the recording. Each time you start the recording, it automatically creates a new data file with a date and time stamp. I hit upon the idea of using a macro program that sends key presses to the program to do this.

I found the free program AutoHotKey through a Google search. Using its built-in scripting language, you can send the commands to start, wait a programmable period of time, then send the command to stop. Here's the simple script I wrote and saved as a text file:

WinActivate SpectraVue 2.21
WinWaitActive SpectraVue 2.21
Send {F12}
Sleep, 240000
Send {F10}

As you might guess, the first two lines make sure the SpectraVue program is active, the next line sends the F12 command to start, the program waits 240,000 milliseconds (4 minutes) then sends the F10 command to stop. Now all that's needed is to run the macro script on a schedule.

To create a scheduled event in Windows XP, go to the Control Panel and click "Scheduled Tasks." Double click "Add Scheduled Task" then browse to the AutoHotKey script file you created. Specify the start time, and make it a daily event. AutoHotKey will run with that script every time it's scheduled, and send the keystrokes to SpectraVue. Once the event is created, right click the event in the Scheduled Task window, click "Properties", then click on the Schedule tab then "Advanced". This lets you repeat the scheduled event every hour throughout the night.

This process provides an hourly schedule execution for SpectraVue recordings, and lets you enjoy nighttime top-of-the-hour ID chasing during the saner hours of daylight!