Re: Streaming using coreaudio
Re: Streaming using coreaudio
- Subject: Re: Streaming using coreaudio
- From: John Michael Zorko <email@hidden>
- Date: Wed, 14 Jan 2009 07:00:55 -0800
Hamish,
Though the fault of no one, clarity seems to be the one thing missing
from our conversation, so let me try again. While NSURLConnection is
great, its' caching behavior is exactly what I _didn't_ want (esp.
when dealing with streams of indeterminate length), and that's why I
replaced it with CFReadStream in my iPhone app, which allowed me much
more control of both the timing and the quantity of data I read from
the server. The result is that my app uses far less memory, which is
definitely a good thing on the iPhone :-)
Ah, sorry, I should have been clearer: the OP mentioned shoutcast, so
I assumed we were talking about a stream of indeterminate length
(expectedContentLength == -1), in which production and consumption
rates are necessarily equal.
For streaming finite length audio, it might be easier to download the
data into a file but start playing the file before the download is
finished. An unfinished and unpolished piece of code I wrote for this
purpose is included below; feel free to use this under a BSD license.
Regards,
John
Falling You - exploring the beauty of voice and sound
http://www.fallingyou.com
_______________________________________________
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