SimpleAudioEngine
There is no method like isBackgroundMusicPlaying
for effects, but you can save a BOOL
called isPlaying and use CDSoundSource
CDSoundSource* currentSound = [[CDAudioManager sharedManager] audioSourceForChannel:kASC_Right]; [currentSound load:audioFile]; currentSound.delegate = self; currentSound.backgroundMusic = NO; isPlaying = YES; [currentSound play];
Then call back:
- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource { isPlaying = NO; }
I don’t know exactly if it is right to initialize the CDSoundSource
, since I stole shamelessly the code from this section . Perhaps you should take a look at the description of the CDAudioManager class
We hope this helps you in the right direction.
ender source share