What is interesting is that they couldn't be more different from one another.
1010 WINS is a NYC based AM broadcast station. It is part of CBS. You'll notice that the streaming is generally just a streaming version of the over-the-air broadcast. Almost a direct translation from 20th century media to 21st century media.
Pandora is an algorithmic system which plays music specifically for you based on your likes and dislikes. You simply put in an artist or song name and go from there. It pays attention to what you say you like and dislike and goes from there.
The tension between the three is very interesting, one is using a kind of AI and the other is "programmed" by whomever would like to and the third is more like traditional broadcast. Human filtering vs. algorithmic filtering. Possibilities for live interaction with other peopole to no possibility of live interaction and so on..
The DMCA is a law passed in 1998 which among other things defined two types of internet radio (interactive and non-interactive) as well as set the ability for a royalty rate to be put into effect for non-interactive stations that play music.
This royalty rate has been going through the courts and various arbitration boards for some time but the current rates are set at:
2006 - $0.0008 (per listener per song)
2007 - $0.0011
2008 - $0.0014
2009 - $0.0018
2010 - $0.0019
with a minimum annual fee of $500.
An organization called SoundExchange was created to collect the royalty payments on behalf of the copyright holders of the record recordings. (In addition, radio stations must also pay royalties to organizations that hold the copyright of the musical composition itself (BMI, ASCAP and SESAC).
These royalty rates are highly controversial as they are very different for over the air broadcasters and can add up very quickly. A station which plays 10 songs an hour to 10 listeners would owe: $1576.80 ($0.18 per hour or $4.32 per day). If you double your listeners, you double your costs: $3153.60.
In 1999 a company called NullSoft (famous for WinAMP) developed SHOUTcast which allowed the psuedo streaming of live audio via an HTTP connection.
Around that time, the MP3 format was quickly becoming the defacto digital audio standard as it was widely supported by both hardware and software players (WinAMP, QuickTime, iPod and so on). (Something that is just starting to occur in the digital video space with H.264)
Streaming via HTTP removed a couple of the issues that had previously plagued audio streaming. Those were getting through Firewalls (such as those setup by corporations to conserve bandwidth) as well as allowing the use of a less proprietary format (at least more commonly in use).
While other audio streaming formats still exist MP3 streaming probably became the most common (RealAudio, Windows Media Audio, AAC and so on).
NullSoft was purchased by AOL and it seems that the SHOUTcast server is now harder to find.
SHOUTcast and Icecast use a model which is include a source, server and client or broadcaster, server and client to stream.
Source Clients/Broadcasters
There are many SHOUTcast/Icecast source clients (broadcasters):
Icecast 3rd Party Source Clients but we will be initially concentrating on using Nicecast which is a Mac only and very professional solution ($40 or free 20 minute broadcast limited demo). (If you are using a PC, I urge you to download and try one of the alternatives).
One of the really nice features of Nicecast is it's integration with SoundFlower and Audio HiJack. Both pieces of software allow users to play audio from any source on their computer and route it to any other software. For instance, you could generate audio with Max/MSP or play it from any other source and route it to Nicecast. The possibilities here are endless.
We have an Icecast server setup on the Asterisk machine. The configuration settings you need to connect to it from any Icecast source client are on the Wiki.
Clients/Players
There are a wide variety of clients that can playback MP3 streams (itunes, winamp, quicktime, flash, windows media player and so on..). The key is getting the link correct.
The easiest way is to link to an M3U (MP3 URL) file. Icecast automatically generates one when someone requests a "mount-point" with a .m3u on the end:
http://asterisk.itp.tsoa.nyu.edu:8000/whatever.m3u
This will cause the stream to open in the default player on the user's machine (such as iTunes or Windows Media Player).
You can also embed a player on a webpage:
QuickTime
Note that with the QuickTime player you have to use the "icy://" protocol as the src (in two places in the above code and not use the .m3u extension.
Example:
There are a bunch of other attibutes that you can use when embedding the QuickTime player such as "HIDDEN" to make it invisible to the user.
Flash
Flash is a great option for playing MP3s off of a webserver (via HTTP). Unfortunately it has some issues with SHOUTcast/Icecast streams due to how it is built.
It assumes that the file is going to be relatively small and therefore buffers the entire thing in memory. With a SHOUTcast/Icecast stream, this could mean buffering forever and therefore crashing the user's computer at some point.
None the less, Flash because it is so ubiquitous is probably still a good option for live audio interaction.
Here is the ActionScript for a very very very simple Flash player (no interface):
package
{
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.display.LoaderInfo;
public class SuperSimpleMP3Player extends Sprite
{
// Streaming URL from flashvars
private var streamURL:String = stage.loaderInfo.parameters.streamurl;
// Sound Channel to monitor
private var song:SoundChannel;
// Request object for obtaining mp3 stream
private var request:URLRequest
// Sound... Factory for initializing our stream
private var soundFactory:Sound;
public function SuperSimpleMP3Player()
{
var request:URLRequest = new URLRequest(streamURL);
soundFactory = new Sound();
soundFactory.load(request);
song = soundFactory.play();
}
}
}
(In order to use this in Flash, it will probably take some modification but the key is the URLRequest object, the Sound object with the load and play methods.)