您的位置:首页 > 移动开发 > Cocos引擎

cocos2d-x 同时播放多个音效的问题

2015-01-28 20:33 537 查看
本文出自 “YYBear笔记
博客,请务必保留此出处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.Builder
 instead
to create and configure a SoundPool instance

Constructor. Constructs a SoundPool object with the following characteristics:


Parameters

maxStreamsthe maximum number of simultaneous streams for this SoundPool object
streamTypethe audio stream type as described in AudioManager For example, game applications will normally use 
STREAM_MUSIC
.
srcQualitythe 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),可以手动改大一点,来解决问题
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐