Hey guys, I see two ways to play sound/music, which one should I use for 3.17 C++?
I recommend to use AudioEngine.
Maybe SimpleAudioEngine is more ‘simple’ to use, but i had lag problems in Android using SimpleAudioEngine, so, i recommend AudioEngine always.
First of all Thank you! Is it stable since it’s mark as experimental?
It does seem to be stable, and a lot of updates have gone into it to fix different problems over the past 2 years. It is the recommended one to use, so perhaps it needs to be moved out of the experimental namespace.
Thank you! I see SimpleAudioEngine
have playBackgroundMusic
but missing from AudioEngine
. So AudioEngine
is playing music is with loop
set to true
? Or maybe I might be missing something?
Just call AudioEngine::play2d for everything. The comments in the AudioEngine.h are very helpful, so check there for how to use it.
AudioEngine
is stable and threaded and there is more functionality than SimpleAudioEngine
. I had started documenting this and never made it back to it. I’ll get it back on my list.
Please don’t get me wrong and it’s great you are working on the docs. I feel the cocos2d-x lack docs, maybe the lack of resources or just the api moving fast and docs can’t keep up.
I agree if AudioEngine
is stable as claimed why not deprecate/remove SimpleAudioEngine
to make it more simple for new users.
If you are test your game in windows platform AudioEngine is very laggy.
SimpleAudioEngine works in windows without any lag. We use simple version just for test in windows platform.
I think that SimpleAudioEngine
has a place. For simple solutions it is less overhead and more time tested on all platforms.
does the experimental::AudioEngine have similar support for effects and music? as far as i know the simple audio engine can preload effects but stream music, I wonder such a streaming Music support is available for the experimental::AudioEngine, because so far I could only find the play2d with preload and uncache support.