您好,登錄后才能下訂單哦!
cocos2d-x 同時播放多個音效的時候,會發現有的音效放不出,有的循環音效放著放著就沒了
后來發現貓膩在Cocos2dxSound.java里:
private static final int MAX_SIMULTANEOUS_STREAMS_DEFAULT = 5;
SoundPool構造的時候要指定并發音頻流的數量
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:
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. |
a SoundPool object, or null if creation failed
這里cocos2d-x設置成5了(I9100設成3),可以手動改大一點,來解決問題
版本:cocos2d-x 3.0
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。