0

I just want to ask if it is possible to stop music from playing when the device sleeps?

I am using SimpleAudioEngine to play music. A user is claiming that the music stops from playing when his phone slept, turning on and off the sound from settings (there's an on/off feature for it) didn't fix the problem.

I tried to reproduce the bug but I can't reproduce it. Is there anyone who experience this kind of problem?

Thanks!

Guru
  • 21,652
  • 10
  • 63
  • 102
0xdeadfa11
  • 63
  • 1
  • 7

1 Answers1

0

in appDelegate:----

void AppDelegate::applicationWillEnterForeground()
{
    CCDirector::sharedDirector()->resume();
    CCDirector::sharedDirector()->startAnimation();

    // if you use SimpleAudioEngine, it must resume here
     SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}
dkumar
  • 33
  • 4