375 Eleventh Street
San Francisco, CA 94103


   
Icecast Scripts

Here's how we do our streaming audio webcasts:

  • From 2001 to early 2006:

    • There was a Linux machine inside DNA Lounge with an audio encoder card (a SoundBlaster Live.) This machine got an audio feed directly from the club's sound system.

    • Scripts on that machine read raw audio from the card, converted it to MP3 in realtime, and sent a single 128k MP3 stream up a T1 to a server machine.

    Since 2006:

    • The machine inside DNA Lounge is a Macintosh Mini, running Nicecast. Same basic idea, but with much more reliable hardware and software.

  • The server machine is a CentOS PC with two 1.66GHz CPUs and 2GB RAM sitting in our ISP's colocation facility (so it has lots of outgoing bandwidth.)

  • That machine runs Icecast, which serves that 128k stream to the outside world.

  • However, we also used to offer the audio streams at lower bitrates, for people who have less bandwidth available to them. We don't do that any more, but the way that used to work is, there were some scripts running on the server machine that would:

    • listen to the 128k stream;
    • decode it;
    • re-encode it at a lower bitrate;
    • send that re-encoded stream back to the server for transmission.

  • Finally, you click on the link to the MP3 stream on our Audio Webcast page, which instructs your browser to launch your favorite MP3 player and connect to the stream on our server.

Here are the shell scripts that make all that work. Please let me know if you find this useful, or make any improvements...