Codebox Software

Old Time Radio

Published:

There are thousands of classic radio shows from the 1930s, 40s and 50s available on The Internet Archive, so I've made an internet radio station for them!

Old Time Radio website screenshot

The server-side components of the site are written in Node.js. When the site starts up it reads this configuration file, which contains a list of id values representing the various radio programmes that the site will broadcast. The site then uses the Internet Archive's metadata API to get a list of the individual episodes that are available for each show, together with the mp3 file urls for each one.

Each show in the configuration file is associated with one or more 'tags' that indicate what type of show it is (eg Comedy, Western, Action). These tags are used to build the list of channels that are available on the site. A playlist is generated for each channel, alternating the shows with vintage radio commercials to make the listening experience more authentic. The commercials are sometimes more entertaining than the shows themselves, being very much of their time.

The audio that you hear on the site is streamed directly from The Internet Archive, my site does not host any of the content. The Same-Origin Policy often limits what websites can do with remotely hosted media. Typically such media can be displayed by other websites, but not accessed by any scripts running on those sites. However the Internet Archive explicitly allows script access to their audio files by including the following header in their HTTP responses:

Access-Control-Allow-Origin: *

This allowed me to write some JavaScript to analyse the audio signal in real-time and produce a satisfying visualisation, making the site more interesting to look at:

Unfortunately there is a bug in iOS 13 which prevents this feature from working on some Apple devices. Users on the affected platforms will see a placeholder animation until the issue is fixed by Apple.

The Internet Archive is an amazing resource, please support them financially if you can. Among the other cool things you can find there are: