Re: Streaming using coreaudio
Re: Streaming using coreaudio
On Wed, Jan 14, 2009 at 08:14:17AM -0800, John Michael Zorko wrote:
>
> Hamish,
>
>>> 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?
>
> Of course not. As an example, the server could deliver 2 megabytes in
> just a few seconds, yet that 2 megabytes might represent 2 minutes or
> more of MP3 audio. If I only have a few audio buffers to hold the audio
> i'm going to decode and play, I don't want what's left of that 2
> megabytes consuming memory.
>
> I also don't see why this is a big deal -- CFReadStream works better for
> this app that NSURLConnection did. It's certainly nothing against
> NSURLConnection, really. CFReadStream allows me to read what I want, as
> much (or as little) as I want, when I want, and because I control the
> amount of data I read, i'm more in control of memory usage, and that
> works better in my audio streaming app on the iPhone.
I'm not a crazy lover of NSURLConnection or anything, but you may be
able to control download rate with NSURLConnection. Just did a
class-dump on Foundation and there's an unpublished NSURLConnection
category (among other unpublished NSURLConnection APIs) that contains
the methods _suspendLoading and _resumeLoading. Haven't tried those
methods but they might make NSURLConnection more usable for this issue.
Marc
_______________________________________________
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