Skip to content

unic8 Studios

Documentations Tutorials FAQs Links Advanced search
You are here: Home arrow News arrow Labs arrow fRadio: native Flash-based internet radio
fRadio: native Flash-based internet radio
Thursday, 22 March 2007

Yesterday I spent some time on Nullsoft's SHOUTcast. It's absolutely fantastic so I take a look at the specifications... WOW! Accessible data via XML? Perfectly for a Flash-based client. I just finished the work on it so have a look at it.

Video

 

Trackback(0)
Comments (14)add comment

Bart said:

 
Hi,
Interesting to see how you implemented a flash based shoutcast player.

I have two questions;

1.
What about the memory leak that Flash has with shoutcast streams. The streams come in the player but will never leave, so eating memory while listening...

2.
How do you get access to the Shoutcast database? I have looked for that before but never found such a xml interface.

Bart
2007-03-26 01:08:47

erik said:

 
Hi Bart,

1. the memory leak problem is still alive smilies/wink.gif but I thought about a solution which handles 2 Sound-objects which will switch between each other every minute to prevent heavy memory usage. An overlay of 5 seconds at switching... hmmm... wish i could spent more time on testing!

2. Try http://www.shoutcast.com/sbin/newxml.phtml and leave without parameters for genre list. Known params are: genre [String] (Filter by genre name), search [String] (Search pattern for genre, station name or song title)

Good luck!
2007-04-10 11:03:48

Internet Radio said:

 
Looks like a funky little player you have designed there erik. Ive just been through your site and i cant find anywhere where i can test it ? Is it not available to the public ?
2007-04-10 20:27:43 | url

Erny said:

 
great project !! my compliment smilies/smiley.gif

one question :

Flash steam only FLV file; what kind of technology do you use to stream different format audio in flash ?
2007-05-18 07:35:07

erik said:

 
Hi Erny,

I just use nothing other than native Flash functions and MP3 streams from Shoutcast.

btw I got to mention that with ActionScript 3 the whole memory leak is gone because Flash is now able to read streams via e.g. a socket connection and is able to flush data.
2007-05-18 18:24:22

Fernando said:

 
Hi Erik

Nice player! You say that there is no memory leak problem with AS3, how are you doing it with AS3? If you keep the same method you use for AS2, I suppose the problem is the same, or not?

Thanks!
2007-05-24 12:04:52

erik said:

 
Hi Fernando,

thanks! AS3 is very different to AS2 - especially if you turn on "strict" mode for compilation ;-). Due the new features like socket-connections and other native network communications capabilities there are many different options for a solution. By coding a custom handler for audio streams you are able to clear the "exhausted" bytes and finally the memory leak is history.
2007-05-24 22:26:13

Fernando said:

 
Hi Erik, thanks for the reply! I'm completely new to AS3 (ok, I know that now it has true sockets connections, and I want to make some tests with it because of other problems I have using AS2 XMLSockets in other project), can you point me some guidelines for this streaming audio solution without memory leaks? I'm very interested in it!

Thanks!!!!

Fernando
2007-05-25 10:13:44

Bart said:

 
Hi Erik, and Fernando

I would like to help making this no-memory leak flash shoutcast player. Have you started already? Maybe we could share code with svn?

Have you heard about miniCaster? http://www.draftlight.net/dnex...inicaster/

They made a player that says it doesn't suffer the memory leak.
Their technique is to start streams every now and then, and mix the two sound objects. But this doesn't work for all streams, and it's hearable.

Bart

Using AS3, binary socket etxm, it might workd for real
2007-05-31 13:35:11

erik said:

 
Hi Bart,

I've already built a player which switches between 2 separate Sound-objects but as you mentioned it is hearable and also an ugly solution. I really appreciate you offer to build a socket-based player with AS3 but for now I'm very chary with Flash 9:

1. The IDE is like the previous version totally absurd for a programmer (btw it hang-up about 8 times inside 20 minutes of normal usage).
2. The as3core library is only now under development at Google Code!?
3. Adobe throw really important things like Remoting, many Components and Flash-based Applications away.
4. All errors in an SWF file (e.g. unregistered event listeners) are thrown via a popup window on each client system which has installed the Flash Player (Developer version). Note: All systems which have installed the IDE have got this version of the player.

At the moment I can't acclaim the strategy of Adobe and Silverlight is fascinating me. I've been developing Flash since version 4 and I really like it but perhaps the good old days of Macromedia's spirit are gone... For now I'm waiting for the first patches of the IDE and the player which will hopfully fix the hardest bugs. Until this release I'll work with version 8 and "play" with version 9.
2007-06-05 19:12:14

Damien said:

 
Hi, do you try to dev your socket solution ? I'm very interesting on it smilies/cool.gif
2007-10-08 09:32:25 | url

Sönke said:

 
nice one,

i'm trying to get shoutcast via flash streaming to work for 3 days now.
i'd really be thankful for some lines of code that display the "native Flash functions" you use for streaming. exactly this is driving me insane (just won't play the stream or saying sandbox violation)

thx in advance
2007-10-26 17:43:14

erik said:

 
hi,

@damien
i never tried a solution with sockets. at the moment i'm focused on other projects.

@sönke
currently the "archived" project got no cleaned and optimized code. i also like to mention that i also got the sandbox errors when i tried the player online. this is the reason why the video shows the standalone flash player. if nullsoft (shoutcast) won't put a crossdomain file on their domain there won't be chance to solve this issue with flash 8 and the sound object.
2007-10-26 17:58:12 | url

sodah said:

 
Hi,

I have developed a icecast/shoutcast radio: http://shoutcast.sodah.de In next time I will use the xml-connection for all stations on shoutcast.com
2007-10-28 12:24:50 | url

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley

security image
Write the displayed characters


busy
 
< Prev   Next >

Polls

Which data exchange technology do you prefer?