Re: Streaming using coreaudio
Re: Streaming using coreaudio
- Subject: Re: Streaming using coreaudio
- From: Christopher Atlan <email@hidden>
- Date: Tue, 13 Jan 2009 20:32:33 +0100
John,
I highly recommend to look at this example:
http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html
... yeah, that one, too :-) The only thing about that is that I
think it's more complicated and resource hungry than it needs to be,
since NSURLConnection is used to do the streaming. NSURLConncetion
is a fine class and all, very easy to use and a truly upstanding
citizen in the Cocoa world, but it's not the best choice for
downloading data when you don't know how large the data is (so it
ends up using a lot more memory), and it calls the didReceiveData()
delegate method on its' own thread, which can complicate other
matters (esp. with Core Audio and its' streaming services API). I
ended up removing that in my code and using CFReadStream() and
friends instead, which gives me a lot more control over the
networking aspect and ended up making my code much simpler.
Matt updated his code to use CFReadStream, so you find a
NSURLConnection version and a CFNetwork version under this link.
I also switched to CFReadStream, but I never had problems with
NSURLConnection, I just did it to make my code more C stylish rather
then try to have to much in obj-c.
Christopher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden