cocos2d-x 同时播放多个音效的问题
2015-01-28 20:33
537 查看
本文出自 “YYBear笔记”
博客,请务必保留此出处http://yybear.blog.51cto.com/9028161/1588068
cocos2d-x 同时播放多个音效的时候,会发现有的音效放不出,有的循环音效放着放着就没了
后来发现猫腻在Cocos2dxSound.java里:
本人讲此值修改为:20
Added in API
level 1
This constructor was deprecated in API level 21.
use
to create and configure a SoundPool instance
Constructor. Constructs a SoundPool object with the following characteristics:
Parameters
Returns
a SoundPool object, or null if creation failed
这里cocos2d-x设置成5了(I9100设成3),可以手动改大一点,来解决问题
博客,请务必保留此出处http://yybear.blog.51cto.com/9028161/1588068
cocos2d-x 同时播放多个音效的时候,会发现有的音效放不出,有的循环音效放着放着就没了
后来发现猫腻在Cocos2dxSound.java里:
private static final int MAX_SIMULTANEOUS_STREAMS_DEFAULT = 5;
本人讲此值修改为:20
Added in API
level 1
This constructor was deprecated in API level 21.
use
SoundPool.Builderinstead
to create and configure a SoundPool instance
Constructor. Constructs a SoundPool object with the following characteristics:
Parameters
maxStreams | the maximum number of simultaneous streams for this SoundPool object |
---|---|
streamType | the audio stream type as described in AudioManager For example, game applications will normally use STREAM_MUSIC. |
srcQuality | the sample-rate converter quality. Currently has no effect. Use 0 for the default. |
Returns
a SoundPool object, or null if creation failed
这里cocos2d-x设置成5了(I9100设成3),可以手动改大一点,来解决问题
相关文章推荐
- cocos2d-x 同时播放多个音效的问题
- 关于Cocos2d-x中音效重复播放问题的解决
- 关于Cocos2d-js中有的音效播放不出来的问题
- cocos2d-x如何播放音乐和音效
- 【Cocos2d游戏开发之十三】CCSprite利用Bezier(贝塞尔)做抛物线动作并让CCSprite同时播放两个Action动作!
- 【iOS-Cocos2d游戏开发之十八】解决滚屏背景/拼接地图有黑边(缝隙)/动画播放出现毛边以及禁止游戏中自动锁屏问题!【2011年12月18日补充】
- Android游戏开发教程之十七:支持多音效同时播放的SoundPool类
- 使用cocos2d的SimpleAudioEngine播放背景音乐和音效
- 【Android】游戏开发--SoundPool类多种音效同时播放
- 【iOS-Cocos2d游戏开发之十三】CCSprite利用Bezier(贝塞尔)做抛物线动作并让CCSprite同时播放两个Action动作!
- 【iOS-Cocos2d游戏开发之十四】音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)
- cocos2d或者iOS制作视频+虚列动画做游戏时候,视频播放和结束时顿闪问题解决方案
- 【Cocos2d游戏开发之十三】CCSprite利用Bezier(贝塞尔)做抛物线动作并让CCSprite同时播放两个Action动作!
- 【iOS-Cocos2d游戏开发之十四】音频、音效播放+Cocos2D-Extensions视频播放! 推荐
- 【iOS-Cocos2d游戏开发之十四】音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)
- 【iOS-Cocos2d游戏开发之十四】音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)
- 【iOS-Cocos2d游戏开发之七】在cocos2d中添加/删除系统组件,并解决View设置透明会影响View中的其他组件的问题!【11月28日更新解决添加组件Cocos2d动画停止播放的BUG】
- 【iOS-Cocos2d游戏开发之十四】音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)
- 【iOS-Cocos2d游戏开发之七】在cocos2d中添加/删除系统组件,并解决View设置透明会影响View中的其他组件的问题!【11月28日更新解决添加组件Cocos2d动画停止播放的BUG】
- 【iOS-Cocos2d游戏开发之十三】CCSprite利用Bezier(贝塞尔)抛物线并同时播放两个Action动作!