Re: AudioQueueDispose vs. AudioQueueStop
Re: AudioQueueDispose vs. AudioQueueStop
- Subject: Re: AudioQueueDispose vs. AudioQueueStop
- From: Craig Hopson <email@hidden>
- Date: Mon, 22 Sep 2008 12:18:04 -0600
John,
It sounds like you are using the "immediate" param backwards. When
the URL loading has finished, the queue still may have (probably has)
stuff in it. So, in this normal completion case, set immediate =
false to allow the queue to empty on its own. Don't dispose until
your kAudioQueueProperty_IsRunning callback fires and you know the
queue has finished.
-Craig
On Sep 22, 2008, at 12:01 PM, John Zorko wrote:
Craig,
You are calling:
AudioQueueStop(myData.audioQueue, false);
And then immediately disposing of the queue (buffers). This is bad.
Please read the documentation re: AudioQueueStop.
Whether you tell the audio queue to stop immediately or not, you
are better off (I think) adding a property listener to the queue
for the kAudioQueueProperty_IsRunning property and only dispose of
the queue when it signals that it actually has stopped.
Ooooh, this makes sense, then ... because I occasionally have a
crash when running this (bus error), and it very well might be the
audio queue trying to dereference something that I errantly disposed
of by calling AudioQueueDispose so soon. Many thanks!
BTW, is there a way I can tell if the audio queue is idle i.e. there
are no buffers left to decode / play? Another problem i'm having is
that once the NSURLConnection tells me it finished loading the URL,
I stop the audio queue (with true), but quite often the last part of
the music is cut off. Is there a property I can query for that?
Regards,
John, working on some other code now, but will re-read the Core
Audio documentation this evening ...
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