Hi,
I might have found a bug in CocosDenshion, correct me if I'm wrong.
In my game, I preload few sound effects with this code:
SimpleAudioEngine *audioEngine = [SimpleAudioEngine sharedEngine];
[audioEngine preloadEffect:@"WrongTapEffect.wav"];
[audioEngine preloadEffect:@"RightTapEffect.wav"];
[audioEngine preloadEffect:@"MenuTapEffect.wav"];
But then at some point later in the code I want to play an effect that I didn't preload.
So I do:
[[SimpleAudioEngine sharedEngine] playEffect:@"BonusEffect.wav"];
but instead of that wav, the first preloaded effect is played (WrongTapEffect).
I took a look at the playEffect method in SimpleAudioEngine and I think that there's a mistake there. In case the effect has not been preloaded, it gets loaded on the fly, but the variable "soundId" is still nil and then it's used to retrieve a value with [soundId intValude] that probably returns 0 and that corresponds to the first preloaded effect.
Sorry, if this is not the case!