when i replace the scene ,in button click function write these lines
void GameLayer::goToMainMenu()
{
SimpleAudioEngine::sharedEngine()->stopAllEffects();
CCDirector::sharedDirector()->replaceScene(CCTransitionFadeTR::create(0.9f, MainScene::create()));
}
but both play effect from game scene and main menu scene occur together