使用CocosDenshion in cocos2d-x
CocosDenshion
1 // 预先加载背景音乐 - init 2 CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadBackgroundMusic("audio_game_back.mp3"); 3 // 播放背景音乐 - init 4 CocosDenshion::SimpleAudioEngine::sharedEngine()->playBackgroundMusic("audio_game_back.mp3", true); 5 // 预先加载音效 - init 6 CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("audio_card_click.mp3");、 7 // 播放音效 - touch 8 CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("audio_card_click.mp3");