Icecast Scripts

by Jamie Zawinski

Here's how we do our streaming audio webcasts:

Here are the shell scripts that make all that work. Please let me know if you find this useful, or make any improvements... This is the script that listens to one icecast stream, and then rebroadcasts it as another, after changing the bitrate. It uses LAME to decode and then re-encode the MP3 data.

This is also the script that reads from the local sound card, converts it to an on-the-fly MP3 stream, and feeds that to an Icecast server. When the club is open we broadcast live audio; but when the club is closed, we used to re-broadcast audio from our archive of past live performances. We don't do that any more, but this is the script that did it. This script rolls through the directory of archived MP3 files and feeds them to the icecast server one after another, from oldest to newest. When it runs out, it wraps around and does it again. Loops, feeding a directory tree of MP3s to an Icecast server, randomized. This is how "DNA Lounge Radio" works. A two thousand line sh script that runs once a minute to attempt to keep our video streams running and keep OBS, Audio Hijack and Loopback in a functional state. Here be monsters.