![]() |
#1 |
Junior Member
Join Date: Apr 2010
Posts: 5
|
SHOUTcast metadata
I'm creating an application that streams audio from the web. It's not a stream ripper, but a radio player. I'm trying to get metadata from the audio, but I got no luck on that. I created a HTTP request and seted the value 1 for the header icy-metadata. Unfortunately, it keeps returning these headers:
Date = "17 Apr 2010 21:57:14 -0200"; "Max-Age" = 0; What I'm doing wrong? What's the trick? |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Nov 2006
Location: USA
Posts: 1,687
|
Metadata for the player arrives at the meta-interval defined in the stream header. It should be inline ascii data that you can see with Wireshark. SO your player needs to be able to determine the meta-interval, parse the metadata, and know when to go back to music data.
Also remember that not all streams use the same meta-interval so you really need to be able to parse the data on a per stream basis. That's about all the info that I have on the subject. Your mileage may vary! |
![]() |
![]() |
![]() |
#3 |
Senior Member
Join Date: Jun 2008
Location: Weston, CT
Posts: 250
|
You should get back a field called icy-metaint. This will be the interval in bytes after which metadata will appear. Here's an online reference to the classic SHOUTcast protocol:
http://forums.radiotoolbox.com/viewtopic.php?t=74 --Neil |
![]() |
![]() |
![]() |
#4 |
Junior Member
Join Date: Apr 2010
Posts: 5
|
Thanks guys. I followed the guide(http://forums.radiotoolbox.com/viewtopic.php?t=74) but the problem is that I'm not getting the right HTTP fields. It keeps returning the Max-Age and the Date fields, and nothing else. It was supposed to return many other fields that are not being returned. Any help is appreciated.
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Join Date: Jun 2008
Location: Weston, CT
Posts: 250
|
I'd need more information to help, but here's some things to check:
1) If you are building the HTTP headers yourself, make sure you don't have a typo or some other error 2) Are you doing the HTTP GET against the correct address? You need to do it directly against a shoutcast server or relay and not some cataloged aggregator like shoutcast.com 3) Regardless of the HTTP responses you get, does the audio stream follow? If not then you're probably poking the wrong internet address. --Neil |
![]() |
![]() |
![]() |
#6 |
Member
|
Make sure to set the user-agent string properly too. If it contains the string "Mozilla" in it, Shoutcast will assume it is a web browser rather than a media player and will serve the status page instead.
Smoothbeats.com hiphop / nujazz |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Apr 2010
Posts: 5
|
|
![]() |
![]() |
![]() |
#8 |
Major Dude
Join Date: Nov 2006
Location: USA
Posts: 1,687
|
Whatever you want to call your player would be fine for the user agent.
Your mileage may vary! |
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Apr 2010
Posts: 5
|
Still no luck
![]() The server is still returning a HTML file. |
![]() |
![]() |
![]() |
#10 |
Senior Member
|
The easiest way to get station data is to simply do station.url:[port]/7.html and parse the data.
idobi Network - http://idobi.com/ idobi Radio - http://idobiradio.com/ idobi App now available for iOS, Android and Windows Phone (http://idobi.com/app/) |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Apr 2010
Posts: 5
|
Thank you man! Thank you so much! You solved my problem!
![]() |
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: Nov 2006
Location: USA
Posts: 1,687
|
Which will probably be going away in the SC2 release unless they have decided to change plans. You have to deal with the meta interval no matter what you do or your music will have oddities when it tries to play the ascii data during the meta interval. That means you will need to parse not only the interval but the length so the player knows when to go back to music. If you are doing both of those then how much more is it to parse the data out of that part of the stream?
Your mileage may vary! |
![]() |
![]() |
![]() |
#13 |
Member
|
I've always referenced the following documentation for details on working with Shoutcast metadata:
http://www.smackfu.com/stuff/programming/shoutcast.html I've found that it works just as documented. Incidentally, this page is the first result if you do a Google search for shoutcast metadata. Smoothbeats.com hiphop / nujazz |
![]() |
![]() |
![]() |
#14 |
Winamp's Womble
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,100
|
one thing to note that in sc2 the protocol is completely different, UVOX rather than the original Shoutcast so will not be as simple to decode.
Hopefully something like 7.html will be implemented to save much messing about stripping out data BW Without open minds the world will die. Open yours and correct the mistakes you are making right now. |
![]() |
![]() |
![]() |
#15 |
Major Dude
|
Yeah, Neil allready said SC2 was moving away from this, as 7.html was a convenient hack.
|
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: Nov 2006
Location: USA
Posts: 1,687
|
And unfortunately since SC2 is going to use something completely different you can pretty much throw out compatibility with most mainstream players again, and we just got iTunes and WMP12 to support everything
![]() Your mileage may vary! |
![]() |
![]() |
![]() |
|
Tags |
audio, development, metadata, stream |
Thread Tools | Search this Thread |
Display Modes | |
|
|