audiostreamer-meta bug fix

I checked in a small but important bug fix to the audiostreamer-meta iPhone streaming audio project. There was a case where the SHOUTcast interval byte would show up on it’s own (buffer length == 1) and that byte was incorrectly getting sent to the audio queue which would cause a sound skip. :( It’s fixed now so if you are using the project look at the diff or grab the new code.

Stream.ly Free Download Codes

Here are some free download codes for Stream.ly, my new iPhone streaming radio app. Check out the Stream.ly website for some stream URLs to get started. The codes are only good for one use so first come first serve.

Stream.ly iTunes

MWHXKN6Y3W9L
XFPT4LPTJWWE
ERL74NXJL9RW
WKMF7TYLLKPR
NY3R6PE7WHTL
64TWKLAN9HFA
R4NNWK3A3PE6
LAL7MJPTAT76
J6EFKX7ANKYK
EN3PWFP3X3F9

You can copy-paste one of these code into iTunes. Click on the Redeem link in the iTunes Store Quick Links box.

Enjoy!

Reading SHOUTcast metadata from a stream

A few people have looked at the source of my Indie 103.1 iPhone App and asked about reading SHOUTcast metadata (artist and track information) from the audio stream. The Indie App code won’t read metadata for SHOUTcast streams – but it does work for Icecast streams. Turns out that SHOUTcast and Icecast (two of the most popular server applications for streaming radio) are supposed to be compatible, but the response message from each server is slightly different.

SmackFu has a great page that documents the ShoutCAST metatdata protocol. They don’t mention the difference in the server response, but you’ll find references to it on Google.

When  you send an HTTP GET request to an Icecast server (like Indie 103.1) it replies with HTTP 200 OK. This is what we’d expect, and you can use CFHTTPMessageCopyHeaderFieldValue to read the response header where you get the Icy-MetaInt value. SHOUTcast responds to an HTTP GET request with ICY 200 OK. When this happens CFHTTPMessageCopyHeaderFieldValue returns null.

One solution is to look for the ICY 200 OK response and parse the headers manually. I’ve created another Google Code project called audiostreamer-meta and used Matt Gallagher’s execelent AudioStreamer example as a sample project. The sample application will parse the metadata from both server streams. Check the debug window in Xcode to see the metadata. The code needs some clean up, and it would be nice to display the artist, tract, and other metadata on the view itself. Feel free to join the project and help make the code better.