//---头文件---//
#include "SimpleAudioEngine.h"
//---单例指针---//
//---CocosDenshion::SimpleAudioEngine::sharedEngine()
//---预加载---//
void preloadEffect(const char* pszFilePath); //音效
void preloadBackgroundMusic(const char* pszFilePath); //背景音乐
//---播放---//
//音效 返回值为播放的id 第二参数是否循环
unsigned int playEffect(const char* pszFilePath, bool bLoop = false);
//背景音乐 第二参数是否循环
void playBackgroundMusic(const char* pszFilePath, bool bLoop = false);
//---停止---//
void stopEffect(unsigned int nSoundId); //停止指定音效 参数为上面的id
void stopAllEffects(); //停止播放所有音效
void stopBackgroundMusic(); //停止播放背景音乐
//------------------------------//
CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); //重新开启音乐
CocosDenshion::SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); //暂停音乐
//--------------调用方式----------------//
CocosDenshion::SimpleAudioEngine::sharedEngine()->functions
Cocoa2d-x 音乐与音效
最新推荐文章于 2019-08-10 11:33:00 发布
