在我的代码中,我在playEffect()之前使用setEffectsVolume()。但它在Android 4.2及更低版本中无效。在Android 4.3中它可以正常工作。
代码如下:
var btnStart = ScaleButton.create(
"res/btn_start_game_normal.png",
"res/btn_start_game_pressDown.png",
function () {
cc.AudioEngine.getInstance().playEffect("res/Music/button.mp3");
setTimeout(function(){
cc.AudioEngine.getInstance().setEffectsVolume(0);
cc.AudioEngine.getInstance().playEffect("res/Music/Sluice.mp3");
},1000);
SceneManager.getInstance().replaceScene(MissionSelect._missionName, SceneTransitions.FadeIn, 1);
},
this
);