Cocos2d-x 音效

来源:互联网 发布:mac如何给文件夹加密 编辑:程序博客网 时间:2024/05/16 09:06


  1. //获得SimpleAudioEngine的实例  
  2. static SimpleAudioEngine* sharedEngine();  
  3. //提前载入音频  
  4. void preloadBackgroundMusic(const charpszFilePath);  
  5. //播放背景音乐,是否循环播放  
  6. void playBackgroundMusic(const charpszFilePath, bool bLoop false);  
  7. //停止背景音乐  
  8. void stopBackgroundMusic(bool bReleaseData false);  
  9. //暂停背景音乐  
  10. void pauseBackgroundMusic();  
  11. //恢复背景音乐  
  12. void resumeBackgroundMusic();  
  13. //重新播放背景音乐  
  14. void rewindBackgroundMusic();  
  15. //是否正在播放背景音乐  
  16. bool isBackgroundMusicPlaying();  
  17. //获得背景音乐音量  
  18. float getBackgroundMusicVolume();  
  19. //设置背景音乐音量  
  20. void setBackgroundMusicVolume(float volume);  
  21. //获得音效音量  
  22. float getEffectsVolume();  
  23. //设置音效音量  
  24. void setEffectsVolume(float volume);  
  25. //播放音效,是否循环播放,返回一个内部维护的ID号  
  26. unsigned int playEffect(const charpszFilePath, bool bLoop false);  
  27. //暂停ID音效  
  28. void pauseEffect(unsigned int nSoundId);  
  29. //暂停所有音效  
  30. void pauseAllEffects();  
  31. //恢复ID音效  
  32. void resumeEffect(unsigned int nSoundId);  
  33. //恢复所有音效  
  34. void resumeAllEffects();  
  35. //停止ID音效  
  36. void stopEffect(unsigned int nSoundId);  
  37. //停止所有音效  
  38. void stopAllEffects();  
  39. //提前载入音效  
  40. void preloadEffect(const charpszFilePath);  
  41. //释放音效  
  42. void unloadEffect(const charpszFilePath);  
  43. 增大音量SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() 0.1f);  
  1. http://blog.csdn.net/a351945755/article/details/7947593

  1. //获得SimpleAudioEngine的实例  
  2. static SimpleAudioEngine* sharedEngine();  
  3. //提前载入音频  
  4. void preloadBackgroundMusic(const charpszFilePath);  
  5. //播放背景音乐,是否循环播放  
  6. void playBackgroundMusic(const charpszFilePath, bool bLoop false);  
  7. //停止背景音乐  
  8. void stopBackgroundMusic(bool bReleaseData false);  
  9. //暂停背景音乐  
  10. void pauseBackgroundMusic();  
  11. //恢复背景音乐  
  12. void resumeBackgroundMusic();  
  13. //重新播放背景音乐  
  14. void rewindBackgroundMusic();  
  15. //是否正在播放背景音乐  
  16. bool isBackgroundMusicPlaying();  
  17. //获得背景音乐音量  
  18. float getBackgroundMusicVolume();  
  19. //设置背景音乐音量  
  20. void setBackgroundMusicVolume(float volume);  
  21. //获得音效音量  
  22. float getEffectsVolume();  
  23. //设置音效音量  
  24. void setEffectsVolume(float volume);  
  25. //播放音效,是否循环播放,返回一个内部维护的ID号  
  26. unsigned int playEffect(const charpszFilePath, bool bLoop false);  
  27. //暂停ID音效  
  28. void pauseEffect(unsigned int nSoundId);  
  29. //暂停所有音效  
  30. void pauseAllEffects();  
  31. //恢复ID音效  
  32. void resumeEffect(unsigned int nSoundId);  
  33. //恢复所有音效  
  34. void resumeAllEffects();  
  35. //停止ID音效  
  36. void stopEffect(unsigned int nSoundId);  
  37. //停止所有音效  
  38. void stopAllEffects();  
  39. //提前载入音效  
  40. void preloadEffect(const charpszFilePath);  
  41. //释放音效  
  42. void unloadEffect(const charpszFilePath);  
  43. 增大音量SimpleAudioEngine::sharedEngine()->setBackgroundMusicVolume(SimpleAudioEngine::sharedEngine()->getBackgroundMusicVolume() 0.1f);  
  1. http://blog.csdn.net/a351945755/article/details/7947593
0 0
原创粉丝点击