When I was developing FireRocker, one of my biggest challenges was to figure out an easy way to get the audio metadata. The classic way is to read the value of a HTTP header and see how many bytes I have to wait for until the metadata is sent. Seems like a bit confusing, hum? Luckily, there’s THE easy way! SHOUTcast streams have an HTML page which you can download and parse to get the audio metadata. Say I have the following URL:
Just add a /7.html to the end of it.
If you downloaded this HTML file and opened it with a plain text editor, you’d see something like this:
<HTML><meta http-equiv="Pragma" content="no-cache"> </head><body>153,1,257,1500,153,32,Adrian - Lacrimi de iubire bY www.FmRadioManele.ro</body></html>
Cool, isn’t it? Now let’s parse it. You can do it in any language, but I will teach you how to write a nice app in Objective-C. Create a new project and name it SHOUTcast metadata(or any name you want). Open your AppDelegate.h and add the following IBOutlets: