Re: Streaming using coreaudio
Re: Streaming using coreaudio
- Subject: Re: Streaming using coreaudio
- From: "Hamish Allan" <email@hidden>
- Date: Wed, 14 Jan 2009 15:33:41 +0000
On Wed, Jan 14, 2009 at 3:00 PM, John Michael Zorko <email@hidden> wrote:
> While NSURLConnection is great, its
> caching behavior is exactly what I _didn't_ want (esp. when dealing with
> streams of indeterminate length)
This is what I don't understand. When you're streaming audio of
indeterminate length, you're always consuming it as fast as the server
produces it, right? All you need to do is copy the contents of the
NSData from -connection:didReceiveData: into your queue buffers (which
are being freed at an equal rate, so you never have to wait), and then
that NSData is autoreleased at the end of the run loop.
In Matt Gallagher's article, he writes:
"Update #4 (2008-12-21): Replaced NSURLConnection with CFReadStream
since it appears that the NSURLConnection's network buffer may be the
cause of out-of-memory problems on the iPhone when playing
non-streaming file sources."
This I can understand, because non-streaming file sources will provide
the data as fast as possible, so the NSURLConnection's buffer will
keep filling up as the delegate method blocks waiting for buffers to
be freed. But I'd treat that as a separate case, download at full
speed and cache the data on disk (because people tend to want to do
other things with non-streaming sources, such as fast forward and
rewind).
Best wishes,
Hamish
_______________________________________________
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