Re: Callback when AUFilePlayer is finished?
Re: Callback when AUFilePlayer is finished?
- Subject: Re: Callback when AUFilePlayer is finished?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Wed, 18 Oct 2006 15:09:37 +0200
On 18.10.2006, at 14:48, David Duncan wrote:
On Oct 18, 2006, at 03:26 AM, M. Uli Kusterer wrote:
I tried this, but it seems that this is called when CoreAudio is
finished *scheduling* the audio, not when it is finished actually
*playing* it. So as a rule it seems I get called shortly after
having started playing a region, while the sound has only just
started playing. I.e. here's a console log:
That appears to be the intent, from AudioUnitProperties.h:
Yeah, I know :-)
in case anyone wonders: I have now resorted to a timer that fires
when the sound should be finished and then checks the current play
time against the duration 5 times a second. Once duration < playTime,
I explicitly stop my graph. The original approach I had in mind
didn't work, because AUFilePlayer just keeps the graph running,
playing silence, so I'd never get -1 as the current play time unless
I had explicitly stopped the player.
Since I can't explicitly stop the player until I know it's actually
finished playing, this was the best approach I found. If anyone finds
a better one, let me know.
I can't believe that CoreAudio would be missing such a basic
facility as a "play finished" notification. I couldn't even find
anything like SoundMgr's CallbackCmd, which could be abused for the
same purpose.
Cheers,
-- M. Uli Kusterer
_______________________________________________
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