Better Icecast/Shoutcast playback using Flash Player 10


Now that Flash player 10 has gone public, we have decided to release a demo of our MP3 stream player. Press “Connect” to start listening. :)

Please install Flash Player 10

Radiotuna has a maximum of 50 listeners. In order to tune in from this page, you will need to install Flash Player 10. Users of previous Flash Player versions should be offered the express install option from this page. The knobs respond to up and down drags of the mouse, not circular gestures

In the first post on this site, we announced the radiotuna Shoutcast radio station. The motive behind launching a radio station playing early 20th century music from off the beaten track should become clearer as we present a new means of tuning into Shoutcast and Icecast streams.

Over at FlexibleFactory, we describe the issues surrounding Flash and MP3 audio streams. The big problem is that listening to MP3 streams using the Flash Player slowly but steadily consumes system memory to the point that over extended listening periods, even the best equipped computers will start to wilt. Using the new features available in Flash Player 10, we’ve come up with an alogrithm that disassembles and reassembles the frames of the MP3 stream in such a way that we can free-up the memory containing audio that has already been played. This completely eliminates the memory issues described above, and means that memory consumption is rarely more than about 30 seconds worth of audio data. Because we deal with the MP3 stream at the socket level, we are also able to ask for (and read) the audio metadata (current track information etc) that is commonly embedded in Icecast and Shoutcast streams. And because, at the other end of the process, we have the sample stream of the decoded MP3 data, we can apply DSP to the signal (the tone controls).

So far, so good… however… Adobe has gradually been tightening up the rules governing socket connections from the Flash Player. This means that in order to connect using a socket, a Flash socket policy server application must be deployed on the host that serves the MP3 Stream. When the running Flash application asks the Flash Player to connect via a socket to the server, the Flash Player will initially connect to port 843 of the server and request a socket policy that lets it know whether or not it is allowed to connect to the actual socket that the application originally asked for. An unfortunate consequence of this is that connection from our player is limited to MP3 stream hosts that are also running a socket policy server to answer the additional port 843 requests from the Flash Player (and handing back the correct response). We’re currently using our own Java implementation for radiotuna and are are also considering a .net implementation.

Anyway… enjoy the music!


About this entry