I have an iphone design question regarding downloading and playing an audio file. Thanks to the Matt Gallagher AudioStreamer sample, I can transfer audio and play it back, but that will not save it locally on the phone later. Using NSURLConnection, I can load and save audio files, but I need to wait until I have downloaded them to launch my AVAudioPlayer, since the data property is read-only. I can not add to the buffer.
My question is, how can I start the download, but then start playing the file after it “loads” enough, but before it finishes? Is there another audio player besides AVAudioPlayer that I can feed to a file when it loads.
The only way I can do it now is to do both in different threads, but then, of course, I would dump the data twice.
Thoughts?
source share