Re: Audio Streaming
Re: Audio Streaming
- Subject: Re: Audio Streaming
- From: Jens Alfke <email@hidden>
- Date: Fri, 25 Jul 2008 16:46:09 -0700
On 25 Jul '08, at 2:34 PM, Erik Aigner wrote:
I receive an audio stream via NSURLConnection, and use NSSound to
play back the received data.
Everytime new audio data arrives i append it to the NSData buffer.
Once i reach a buffer limit, i start playing back with NSSound. The
problem with this is, it only plays as long as the buffer was the
time i created the NSSound object with initWithData:bufferData.
That's a really creative idea, but I can see why it wouldn't work
(NSSound probably copies the data buffer, so no changes you make after
starting will have any effect.)
Is there an EASY! way to solve this Problem?
(QTMovie doesn't work in this case btw)
If it's being streamed over HTTP, you can use QTMovie. Otherwise, you
have to roll your own solution using NSURLConnection + AudioFileStream
+ AudioQueue. It's definitely not easy :-(
It would be nice if Apple could put out some sample code showing how
to do this, since people keep asking about it. I have my own code, but
it's not well-factored enough to give out standalone.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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