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!
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 the various radio shows 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.
The configuration file also contains a list of channels (eg Comedy, Western, Action) and specifies which shows should be played on each one. 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:
- The Wayback Machine - saves old versions of websites and lets you see how they have changed over time
- The Internet Arcade - lets you play hundreds of old arcade games for free in your browser
- The Software Archive - preserves and provides access to rare and hard to find legally downloadable software
- The Open Library - a free, digital lending library with over 2 million eBooks
- The Moving Image Archive - hosts millions of free movies, films and videos including Sex Madness, Killers from Space and Invasion of the Bee Girls!