Saturday, February 6, 2016

[20160206] cocos2d-x SimpleAudioEngine Performance Issue : ...lag with playEffect

Original Post

PERFORMANCE ISSUE CAUSED BY SIMPLEAUDIOENGINE ON ANDROID 5.0

Posted on April 30, 2015 by zhangxm — 2 Comments ↓
SimpleAudioEngine will cause performance issue on Android 5.0.

Reason

SimpleAudioEngine uses SoundPool to play effects. But the implementation of SoundPool has performance issue on Android 5.0. Detail information please refer to this thread.

How to fix

Cocos2d-x added new audio engine since v3.3. It uses OpenSL ES to play effects and background musics. But it is not easy to port it to v2.x, so we made a patch for developers using v2.x.

Steps to use new audio engine in v2.x

download this patch
upzip the patch and  replace corresponding files
compile and run your game
If you want to know the detail modification, you can refer to this commit.

Please let us know if you find any problem.

Thanks.

No comments:

Post a Comment