我在Android 5上遇到了Cocos2dx 2.2.6的问题。在玩了一段时间之后,它开始严重滞后。 Android 4不会发生这种情况。经过一些研究,很多人都说Android 5使用Cocos2dx的音频引擎是一个问题。不幸的是,我还没有想出一个解决方案。我确信这是问题,因为如果我在Android 5上从我的游戏中取出声音和音乐,那么就没有任何延迟。有些人说要从Cocos2dx 3中获取声音引擎文件,但我不知道如何设置它。我相信这是一个严重的问题,然后许多cocos2dx 2.2.6用户正在拥有,所以我觉得有人提出了某种解决方案。以下是我收到的一些错误,如果有帮助的话。
05-19 19:24:54.472: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:54.472: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:55.724: E/AudioTrack(16766): AudioTrack::set : Exit
05-19 19:24:56.304: E/ExtMediaPlayer-JNI(16766): QCMediaPlayer could not be located....
05-19 19:24:56.304: E/MediaPlayer-JNI(16766): QCMediaPlayer mediaplayer NOT present
05-19 19:24:56.374: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:56.374: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:56.604: E/ExtMediaPlayer-JNI(16766): QCMediaPlayer could not be located....
05-19 19:24:56.604: E/MediaPlayer-JNI(16766): QCMediaPlayer mediaplayer NOT present
05-19 19:24:56.644: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:56.644: E/MediaPlayer(16766): Should have subtitle controller already set
05-19 19:24:57.645: E/AudioTrack(16766): AudioTrack::set : Exit
05-19 19:24:57.846: E/AudioTrack(16766): AudioTrack::set : Exit
05-19 19:24:58.076: E/AudioTrack(16766): AudioTrack::set : Exit
05-19 19:24:58.276: E/AudioTrack(16766): AudioTrack::set : Exit
答案 0 :(得分:1)
就像你说的,这是旧的SimpleAudioEngine与android 5.x的已知问题。
新的实现已集成到cocos2d-x 3.3及更高版本中,并为2.x编写了补丁。您可以在此处获取更多信息:http://blog.cocos2d-x.org/2015/04/performance-issue-caused-by-simpleaudioengine-on-android-5-0/