android - 使用 native CocosDenshion、cocos2d-x 循环播放音效时,AudioFlinger 无法创建音轨,状态为 : -12 ,

标签 android c++ cocos2d-x audioflinger

每当我尝试使用 CocosDenshion 和 cocos2d-x 循环播放声音时,我都会收到以下错误: my error

我使用的是稳定的cocos2d-2.0-x-2.0.2,我的代码是:

CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("sound/sound_ocean_ambmusic.ogg", true);

这发生在我的手机(Samsung Galaxy S III,verizon)和 android 模拟器上,都是 4.0 版,ICS。

我能做什么?

最佳答案

我有同样的错误。对我有什么帮助?

当你每次播放声音时记录你想播放什么声音然后检查这个文件是否可能太大我的是 30 KB(所以我把它削减到 17 KB)。我使用 .ogg

接下来尝试修改 Android Cocos2dxSound 并添加另一个 SoundPool 或将您的 Activity 流减少到 6 meybe。

关于android - 使用 native CocosDenshion、cocos2d-x 循环播放音效时,AudioFlinger 无法创建音轨,状态为 : -12 ,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12230683/

相关文章:

c++ - 从 OpenCV FileNodeIterator 保存/读取矩阵

java - 从 ByteBuffer 解析多个 JSON

android - 当布局宽度为 720 时,RelativeLayout.getWidth 返回 0

c++ - Bison 移位/减少冲突无法解决

c++ - Float 和 Double 值在 c 中造成困惑

android - cocos2d-x 未定义引用

c++ - Cocos2d-x TiledMap,调用getLayer()获取碰撞层时返回nullptr?

c++ - 需要使用 JNI 释放 jboolean 吗?

Android Camera2 应用程序在离开相机 Activity 并重新进入后中断

android - 为 Android > 4.0 Webkit 的焦点禁用文本输入的矩形(橙色边框)