cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.24k stars 7.06k forks source link

[Linux] AudioEngine does not erase audio instance (id) after playback #17151

Open NinjaGah opened 7 years ago

NinjaGah commented 7 years ago

Steps to Reproduce:

  1. Play > 32 sound effects and let them finish playing on their own
  2. Any sound effect after will "Fail to play %s cause by limited max instance of AudioEngine"

Potential fix: I'm not too familiar with the code base I only skimmed through it.

In AudioEngine-linux.cpp AudioEngineImpl::onSoundFinished(...) the corresponding id is not removed from the AudioEngine. Simply calling AudioEngine::remove(id) seemed like fixed this issue.

dumganhar commented 7 years ago

It's hard to maintain so many platforms. Since linux also supports OpenAL, I will do a refactor to make linux, win32, mac and ios share the same code base which uses OpenAL. :) I mean, replace FMOD with OpenAL for linux.

jhchiarelli commented 7 years ago

In version 3.15 has not yet been fixed, can you tell me if you have any corrections for the next version? Thank you.