views:

429

answers:

1

Are there any tutorials that discuss how to stream audio from the Internet to the iPhone for OS 3.x? The only one I've seen is very outdated and doesn't compile: http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html.

+1  A: 

Are you in control of the content or not? If you're in control, you could use HTTP Live Streaming, which is trivial to play with the MPMoviePlayerController, though you'll lose your GUI. The alternative answer, if you're playing something like a Shoutcast stream, is to use the gamut of Core Audio services, primarily Audio File Stream Services to parse the stream into packets, and Audio Queue Services to play back. And yes, that'll be hard.

invalidname
Unfortunately, I'm not in control of the content. It's mostly MP3 files on various web servers. I don't think it will work as you mentioned right?
4thSpace
Right. HTTP Live Streaming is a specific protocol they would have to implement, and is orthogonal to other protocols like Shoutcast and Icecast. To support those, you'll have to do your own implementation to parse the stream and feed the audio data to Core Audio (unless someone has already cooked up a library to do this).
invalidname