
I’m going to refer to the iPod Touch as the iTouch when I write, it’s easier.
Anyway, I bought an iTouch earlier today, or rather TinyTube bought one b/c there are a lot of Apple mobile user-agents showing up over there. We want to be able to test for the Apple devices, but there are no good iPhone emulators available that I’m aware of.
I figured out earlier how to stream video to the iPhone, and it turns out that the iTouch works the same way. Easy. Basically it uses the Range: HTTP header to buffer chunks of the file for playback. It’s progressive streaming the video. Audio files work the same way. I’ve been able to get this to work with MP3 files, but not (yet) AAC files. Great, so we can stream audio files off our server to the iTouch.
But what about MP3 net radio, does it work? Nope. I tried surfing over to Shoutcast on the iTouch and using the .pls files there to stream. No go. Looks like the iTouch doesn’t understand how to parse .pls or .m3u files. I then tried ripping an Icecast URL directly out of a .pls file. Again, no go. Looks like the iTouch doesn’t understand Icecast protocol either.
Hmm… but it is able to stream static audio files okay. So, is there a way to trick iTouch into treating the Icecast stream as a static file? Of course the answer is yes, and my next technical post will cover some of the details on how to make it happen.
For now you can just listen to the result, it’s serving up the “Groove Salad” station I found on Shoutcast. Hit this on your thing: http://sparkle.wooly.org/cgi-bin/iStream.
Prune | 06-Mar-08 at 9:26 am | Permalink
Hi,
I would like to stream to my iphone. I looked at your site and am wondering if you could share your CGI ?
Can you explain what is it doing exaclty ?
It seems to be playing the stream as a “big static file”, in the same tcp socket as the one of the get of the CGI, also giving a 206 html error code….
Please tell me more !!
Bill | 20-Mar-08 at 8:20 am | Permalink
Allen: I like it. I suppose Apple has reasons for not supporting streaming audio, but since the iTouch is a dandy little portable computer, it’s a surprise that they wouldn’t, as it adds value to the iTouch.
Anyway, I’d like to see more on how to do this.
allenday | 20-Mar-08 at 11:47 am | Permalink
Hi Guys,
I’ll do a write-up shortly. I’m in the middle of writing my PhD dissertation right now.
@Prune
The 206 HTTP response code means “partial content” in response to a range request. It’s not an error, it’s more similar to a 200 OK.
Allen Day’s Weblog :: Moving the blog | 02-Apr-08 at 2:47 am | Permalink
[...] get around to migrating the only useful post on the old blog, check it out, I managed to trick the iPhone to play internet radio. Yes, that means live broadcasts. Same works for live video, but I’m not ready to show [...]