I had the following code:
[[SimpleAudioEngine sharedEngine] setEnabled:NO];
//Some stuff that usually plays sounds
[[SimpleAudioEngine sharedEngine] setEnabled:YES];
and I still got sound. I added a few dozen printouts to the code and noticed that when I set enabled to NO, enabled_ in the SAE was already NO, so it went on nicely.
However, I still got sound.
I noticed that the init for all other sound classes set enabled_ to YES, but the one for SimpleAudioEngine did not.
if((self=[super init])) {
am = [CDAudioManager sharedManager];
soundEngine = am.soundEngine;
bufferManager = [[CDBufferManager alloc] initWithEngine:soundEngine];
mute_ = NO;
enabled_ = YES; // Added by me
}
return self;
Adding that fixed things. Is this a bug or am I doing things wrong?