cocos2dx中可以使用SimpleAudioEngine音频引擎添加和管理项目中的音频和特效,SimpleAudioEngine是一个共享的单例对象,
1,SimpleAudioEngine简介
SimpleAudioEngine在扩展库libAudio中,使用的时候需添加进项目中,声明在命名空间namespace:CocosDenshion中。
2,SimpleAudioEngine方法
播放:
SimpleAudioEngine::getInstance()->playBackgroundMusic("background.mp3",true);
SimpleAudioEngine::getInstance()->playBackgroundMusic("background.mp3",false);
SimpleAudioEngine::getInstance()->playEffect("background.mp3",false,1.0,1.0);
暂停:
SimpleAudioEngine::getInstance()->pauseBackgroundMusic();@H_404_20@
SimpleAudioEngine::getInstance()->pauseEffect();@H_404_20@
@H_404_20@SimpleAudioEngine::getInstance()->pauseAllEffects();@H_404_20@@H_404_20@
恢复:@H_404_20@
SimpleAudioEngine::getInstance()->resumeBackgroundMusic();@H_404_20@@H_404_20@
SimpleAudioEngine::getInstance()->resumeEffect();@H_404_20@@H_404_20@@H_404_20@
SimpleAudioEngine::getInstance()->resumeAllEffects();@H_404_20@@H_404_20@@H_404_20@
停止:@H_404_20@
SimpleAudioEngine::getInstance()->stopBackgroundMusic();@H_404_20@@H_404_20@@H_404_20@
SimpleAudioEngine::getInstance()->stopEffect();@H_404_20@@H_404_20@@H_404_20@
SimpleAudioEngine::getInstance()->stopAllEffects();@H_404_20@@H_404_20@@H_404_20@
@H_404_20@
@H_404_20@
@H_404_20@
@H_404_20@
@H_404_20@
以上是内存溢出为你收集整理的cocos2dx学习日记四:SimpleAudioEngine使用全部内容,希望文章能够帮你解决cocos2dx学习日记四:SimpleAudioEngine使用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)