Mute and Unmute Sound in Cocos2D

By | May 19, 2011

Hi,

In order to mute and unmute sound in Cocos2D iPhone, use the following code.

if ([[SimpleAudioEngine sharedEngine] mute]) {
            // This will unmute the sound
            [[SimpleAudioEngine sharedEngine] setMute:0];
}
else {
             //This will mute the sound
             [[SimpleAudioEngine sharedEngine] setMute:1];
}

๐Ÿ™‚

One thought on โ€œMute and Unmute Sound in Cocos2Dโ€

Leave a Reply

Your email address will not be published. Required fields are marked *