cocos2dx 中怎么判断音效播放完

2026年09月25日 19:28
有1个网友回答
网友(1):

udioEngine.cpp的实现,感觉自己写一个是可以的,所以将代码贴出来,跟大家分享下。

  SimpleAudioEngine.h文件中添加以下函数定义:

  //判断当前音效是否已经播放完
  bool getEffectIsPlaying(unsigned int nSoundId);

  SimpleAudioEngine.cpp函数实现,比较简单:
  //判断当前音效是否已经播放完
  bool SimpleAudioEngine::getEffectIsPlaying(unsigned int
  nSoundId)
  {