| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
I'm trying to retrieve the (id3?) info from a streaming web radio in Flash. Say I have a connection to http://scfire-dll-aa04.stream.aol.com:80/stream/1022 to stream live radio from in Flash. It's no problem setting up the Sound and SoundChannel objects. The problem is trying to retrieve the ID3-tag for the stream, since the event Event.ID3 is never triggered. (This probably has to do with the fact that the file never fully loads.)
Is there any other way to get the stream info? |
|
|
|
|
|
#2 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
Nobody knows?
I know for sure that there is (something like) an ID3-tag sent with the stream, since winAmp is able to show that. I also found out that meta data is sent every X bytes. See below: Network received: 745363 bytes Server: Firehose Ultravox/SHOUTcast Relay Server/Linux v2.5.5 Content-Type: audio/mpeg Metadata received: 142 bytes Metadata interval: 24576 bytes Stream name: 181.fm - The Buzz (Your Alternative Station!) Current title: Chevelle - I Get It So I guess you should be able to retrieve this info with AS3 as well. How? I don't know. I hope somebody can help me with this. Thanks in advance, -FB |
|
|
|
|
|
|
|
|
#3 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
Ha, let me answer my own question in post #2.
When you know the server IP and port you can open a socket connection to it and retrieve the stream information as I found on the winAmp forums. I took this piece of PHP code and tested a bit with it, to see if it has the desireable results. PHP Code:
It does give you almost all the information you want. The only thing I'm missing is the stream name. The thing is, this is all nice and fun, but useless when you don't know the server's ip and port. So let's say you're able to get all radio stations from shoutcast.com, but they only provide you a list with urls to use to tune in to the station. My test case with this showed a big problem with this method right away. The URL I used is: http://www.snakenetmetalradio.com/Snakenet-96k.asp This URL is located on the following IP: 130.94.243.192 BUT, the actual shoutcast server is located on this IP: 205.188.215.231 and port: 8016. So even if you were able to retrieve the IP of an url some way in Flash, you're still only guessing that the shoutcast server is running on the same IP. After that you also have to guess the port number. All in all I didn't really get any further, unless I decide to build my own list with radio stations in XML and fill that with the right info (like IP, port, stream name, etc.) myself. Well, I love how this monologue is going, but hopefully this will help somebody some other day. Or maybe there is someone able to help me with this? Last edited by FrodoBaggins; 10-17-2007 at 06:31 PM.. Reason: forgot to post the url to the working PHP script |
|
|
|
|
|
#4 | |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
Interesting post on http://weblogs.macromedia.com/produc.../06/index.html
Quote:
|
|
|
|
|
|
|
#5 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
Great! now there are different ways to get the same info, but if one way works, the other won't! Ah well, I guess we'll get there some time!
Compare this url the the php script above. http://www.smackfu.com/stuff/programming/shoutcast.html |
|
|
|
|
|
#6 |
|
Flash Programmer
|
Hmmm... Seems simple enough to do with PHP... Ahh, well. I'll try to make a little java app which you can call with PHP.
|
|
|
|
|
|
#7 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
I never said it was really hard using PHP, just found out that there is more than one way leading to Rome!
![]() Thanks in advance any way! ![]() |
|
|
|
|
|
#8 |
|
Flash Programmer
|
Still, I like PHP, but it's just not that good for sockets (in my opinion). I prefer java for development with sockets. Also, there was a slight (okay, maybe more...) delay, so it should be done in a few hours.
Edit: Also, that article you provided is proving very useful. |
|
|
|
|
|
#9 |
|
Flash Programmer
|
It's done. It should work with any Shoutcast stream. It will output something like this:
Code:
<?xml version="1.0"?>
<metadata>
<StreamUrl></StreamUrl>
<icy-name>181.fm - The Buzz (Your Alternative Station!)</icy-name>
<icy-url>http://www.181.fm</icy-url>
<icy-pub>1</icy-pub>
<icy-genre>Alternative Rock</icy-genre>
<StreamTitle>Beastie Boys - Sabotage (Clean Version)</StreamTitle>
<icy-br>128</icy-br>
<icy-metaint>24576</icy-metaint>
<icy-notice2>Firehose Ultravox/SHOUTcast Relay Server/Linux v2.5.5<BR></icy-notice2>
<icy-notice1><BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR></icy-notice1>
<content-type>audio/mpeg</content-type>
</metadata>
Code:
...adata [ip/domain] [port] [path]")... Last edited by icktoofay; 10-22-2007 at 03:46 AM.. |
|
|
|
|
|
#10 |
|
Fellowship of the Script
Join Date: Jan 2006
Location: the Netherlands / heading to the UK
Posts: 629
|
awesome mate! I'll try and test this as soon as I got time. Than after that I'll (try and) disect it to see how it works, cause that is the most interesting part to me.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Info out of radio buttons components | miguelangelo | Components | 4 | 10-08-2007 04:20 PM |
| combobox and radio info not posting to phpfile | lelales | Components | 10 | 06-27-2006 01:01 AM |
| flash radio stream player: possible ? | alexandre_lab | ActionScript 2.0 | 4 | 09-26-2004 12:26 PM |
| Old and New in ActionScript | Madokan | ActionScript 2.0 | 3 | 01-04-2004 07:37 PM |
| Shoutcast Radio Stream - Sound.loadSound("Shoutcast" , isStreaming); | Funky | ActionScript 1.0 (and below) | 2 | 08-08-2002 04:30 AM |