Page Created: 7/30/2014   Last Modified: 4/4/2018   Last Generated: 8/9/2019
Years ago, I created a Linux and Bash shell based time-shifting script to record some live AM and shortwave talk radio shows so I could listen to them later, especially the ones that came on late at night when I was asleep. It worked in conjunction with the IdThreePlugin so that I could just click on a show to play it. While USB FM tuners were widely available and inexpensive, the longer-wavelength, amplitude modulation computer tuners were harder to find and more expensive. So I simply connected the audio earphone or headphone output of an AM/shortwave radio into the sound card line-in input (carefully setting the volume to avoid clipping).
I originally got my inspiration from an older, similar project↗ that uses TCL, but I wrote mine from scratch using Bash and included a download/tagging function.
I took it offline to change the audio codec from mp3 to the Xiph.Org Foundation's Opus↗, but it was so new at the time that a lot of tools, especially those for Opus metadata tagging, did not support it. I eventually had to write my own command-line "shim" program using Python and Mutagen↗ to get this functionality and have since been waiting for Vorbiscomment to support it. Opus is a free and open, flexible and efficient codec that is ideal for compressing talk radio shows. Most shows are an hour or more in length, and Opus can scale down to bitrates of 6 Khz and still deliver intelligible voice. It can also scale up for high-fidelity audio, such as FM wideband.
I have since adapted the script to record from several audio sources (line-in/mic, RTL2832U software-defined radio, and Internet streams), but haven't decided to release the new version yet. I hope to one day integrate it into my PacketRadio and TrillSat interfaces to control the UV-5R series of radio to record amateur radio nets↗, since the nets near me are weekly or monthly, which are easy to miss and not available via podcast.
One interesting feature about the TrillSat project is that the radio can be remotely turned on, off and the frequency changed. So before a show or net, the radio turns on, tunes to the frequency, the show could be recorded, compressed, and tagged, and the radio is turned off. The RTL2832U device is also easy to control thanks to good command-line tools like rtl_fm, but I like integrating automated frequency control into the UV-5RA.