views:

32

answers:

1

is there a finished playing callback with finch? similar to - audioPlayerDidFinishPlaying in the avaudioplayer stuff? looking through the code i could not find anything that referenced it.

+1  A: 

There is no such callback in Finch, because OpenAL does not support it. (Or at least it did not support it when I last looked.) You can fake it like this:

- (void) playSoundWithCallback {
    [someSound play];
    [someDelegate performSelector:@selector(soundDidFinishPlaying:)
        withObject:someSound afterDelay:someSound.duration];
}

I did not try it, but it’s a simple code, it should work fine. Well… at least until you start messing with the pitch and therefore the sound speed :)

zoul
I haven't dug too deep into Finch/OpenAL, but there might be a way to poll to see if a sound is playing or not? This would be a little more complicated, but would work even if the pitch is changing.
Adam