I want to stop in two seconds after me.I tried as follows.
-(void)start
{
SimpleAudioEngine::getInstance()->setEffectsVolume(0.5);
SimpleAudioEngine::getInstance()->preloadEffect(“r.mp3.mp3”);
SimpleAudioEngine::getInstance()->playEffect(“r.mp3.mp3”,true);
int soundIDone = SimpleAudioEngine::getInstance()->playEffect(“r.mp3.mp3”);
this->scheduleOnce(schedule_selector(GameScene::stop), 2);
}
-(void)stop(float dt)
{
SimpleAudioEngine::getInstance()->stopEffect(true);
}
Please tell me how to stop after 2 seconds.