0

I'm using some sound effects and background music in my cocos2d-x app. When I try to pause using

CocosDenshion::SimpleAudioEngine::getInstance()->pauseAllEffects()

it don't pause sounds. StopSounds also not working

CocosDenshion::SimpleAudioEngine::getInstance()->stopAllEffects()

Although pauseBackgroundMusic() is working fine. I'm playing effects that way :

CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(fileName)

I also try by getting effect id and pausing that effect but it too doesn't work.

Nargis
  • 739
  • 7
  • 30
  • Where you use this function to pause all effects? There might me chances that somewhere in you code the function `playEffect(fileName)` get executed meanwhile. – Vijay Masiwal May 21 '15 at 07:39
  • I guess that is true. Can we do something like that sound doesn't play even when playEffect is called. – Nargis May 21 '15 at 07:44
  • Yes, you can take a global boolean variable and check the value before playing any effect. If the pause state is true then don't execute your play effect method. – Vijay Masiwal May 21 '15 at 07:45
  • Thank you.I'm going to try that. – Nargis May 21 '15 at 07:47

0 Answers0