Old 19th April 2010, 15:49   #1
fernandovalente
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?
fernandovalente is offline   Reply With Quote
Old 19th April 2010, 16:31   #2
Greg_E
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!
Greg_E is offline   Reply With Quote
Old 19th April 2010, 17:23   #3
nradisch
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
nradisch is offline   Reply With Quote
Old 21st April 2010, 06:18   #4
fernandovalente
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.
fernandovalente is offline   Reply With Quote
Old 21st April 2010, 11:12   #5
nradisch
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
nradisch is offline   Reply With Quote
Old 22nd April 2010, 19:19   #6
smoothbeats
Member
 
Join Date: Feb 2006
Posts: 53
Send a message via AIM to smoothbeats
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
smoothbeats is offline   Reply With Quote
Old 23rd April 2010, 00:36   #7
fernandovalente
Junior Member
 
Join Date: Apr 2010
Posts: 5
Quote:
Originally Posted by smoothbeats View Post
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.
What's the the right User-Agent?
fernandovalente is offline   Reply With Quote
Old 23rd April 2010, 17:42   #8
Greg_E
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!
Greg_E is offline   Reply With Quote
Old 24th April 2010, 07:21   #9
fernandovalente
Junior Member
 
Join Date: Apr 2010
Posts: 5
Still no luck

The server is still returning a HTML file.
fernandovalente is offline   Reply With Quote
Old 25th April 2010, 08:26   #10
idobi
Senior Member
 
idobi's Avatar
 
Join Date: Feb 2003
Location: Washington DC
Posts: 119
Send a message via AIM to idobi
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/)
idobi is offline   Reply With Quote
Old 26th April 2010, 08:14   #11
fernandovalente
Junior Member
 
Join Date: Apr 2010
Posts: 5
Thank you man! Thank you so much! You solved my problem!
fernandovalente is offline   Reply With Quote
Old 26th April 2010, 13:29   #12
Greg_E
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!
Greg_E is offline   Reply With Quote
Old 26th April 2010, 14:47   #13
smoothbeats
Member
 
Join Date: Feb 2006
Posts: 53
Send a message via AIM to smoothbeats
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
smoothbeats is offline   Reply With Quote
Old 27th April 2010, 09:13   #14
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
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.
bored_womble is offline   Reply With Quote
Old 27th April 2010, 17:25   #15
Brutish Sailor
Major Dude
 
Brutish Sailor's Avatar
 
Join Date: Jan 2009
Location: San Diego CA
Posts: 998
Send a message via Skype™ to Brutish Sailor
Yeah, Neil allready said SC2 was moving away from this, as 7.html was a convenient hack.
Brutish Sailor is offline   Reply With Quote
Old 27th April 2010, 17:51   #16
Greg_E
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!
Greg_E is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Tags
audio, development, metadata, stream

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump