前端之家收集整理的这篇文章主要介绍了
cocos2d-x 音效,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
using namespace CocosDenshion;
//SimpleAudioEngine::getInstance()->playBackgroundMusic("music/game_music.mp3");
SimpleAudioEngine::getInstance()->playEffect("music/game_over.mp3");
//preloadEffect,stopBackgroundMusic,stopEffect,stopAllEffects,//virtual void pauseBackgroundMusic(); //暂停背景音乐
//virtual void pauseEffect(unsigned int nSoundId); //暂停指定音效,nSoundId为音效编号
//virtual void pauseAllEffects(); //暂停所以音效
//virtual void resumeBackgroundMusic(); //恢复背景音乐
//virtual void resumeEffect(unsigned int nSoundId); //恢复指定音效,nSoundId为音效编号
//virtual void resumeAllEffects(); //恢复所有音效
//isBackgroundMusicPlaying();
原文链接:https://www.f2er.com/cocos2dx/341914.html