cc.Audio = cc.Node.extend({
ctor:function(){
this._super();
//cc.audioEngine控制音乐
cc.audioEngine.playMusic("",true);//播放指定音乐
cc.audioEngine.stopMusic();//停止音乐
cc.audioEngine.pauseMusic();//暂停音乐
cc.audioEngine.resumeMusic();//恢复音乐
cc.audioEngine.rewindMusic();//重新播放音乐
cc.audioEngine.getMusicVolume();//获取音乐音量,返回值范围0-1
cc.audioEngine.setMusicVolume(0.5);//设置音乐音量,音量设定值范围为0-1
cc.audioEngine.isMusicPlaying();//背景音乐是否在播放;
//cc.audioEngine控制音效
cc.audioEngine.playEffect("",true);//播放指定音效
cc.audioEngine.stopEffect(132);//停止指定音效
cc.audioEngine.stopAllEffects();//停止所有音效
cc.audioEngine.pauseEffect(13);//暂停指定音效
cc.audioEngine.pauseAllEffects;//暂停所有音效
cc.audioEngine.resumeEffect(123);//恢复播放指定音效
cc.audioEngine.resumeAllEffects();//恢复播放所有音效
cc.audioEngine.getEffectsVolume();//获取音效音量,返回值范围0-1
cc.audioEngine.setEffectsVolume(0.5);//设置音效音量,音量设定值范围为0-1
cc.audioEngine.unloadEffect("123");//卸载指定音效
},
});
ctor:function(){
this._super();
//cc.audioEngine控制音乐
cc.audioEngine.playMusic("",true);//播放指定音乐
cc.audioEngine.stopMusic();//停止音乐
cc.audioEngine.pauseMusic();//暂停音乐
cc.audioEngine.resumeMusic();//恢复音乐
cc.audioEngine.rewindMusic();//重新播放音乐
cc.audioEngine.getMusicVolume();//获取音乐音量,返回值范围0-1
cc.audioEngine.setMusicVolume(0.5);//设置音乐音量,音量设定值范围为0-1
cc.audioEngine.isMusicPlaying();//背景音乐是否在播放;
//cc.audioEngine控制音效
cc.audioEngine.playEffect("",true);//播放指定音效
cc.audioEngine.stopEffect(132);//停止指定音效
cc.audioEngine.stopAllEffects();//停止所有音效
cc.audioEngine.pauseEffect(13);//暂停指定音效
cc.audioEngine.pauseAllEffects;//暂停所有音效
cc.audioEngine.resumeEffect(123);//恢复播放指定音效
cc.audioEngine.resumeAllEffects();//恢复播放所有音效
cc.audioEngine.getEffectsVolume();//获取音效音量,返回值范围0-1
cc.audioEngine.setEffectsVolume(0.5);//设置音效音量,音量设定值范围为0-1
cc.audioEngine.unloadEffect("123");//卸载指定音效
},
});