Error playing mp3 on mobile safari

Error playing mp3 on mobile safari
0.0 0


Hi i use cc.AudioEngine.getInstance().preloadSound to preload all my mp3 in the loading layer.
and play the effect in the game.

everything works perfectly so far in the normal desktop browser (Chrome, Safari, Firefox)

But in my iphone’s safari.
I am getting
Error: res/sounds/01-hit_punch_m.mp3 greater than 10
when playing the effect

and the game crash on cc.AudioEngine.getInstance().stopAllEffects();

INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.

the mp3 itself is only 8kb.
can’t figure out what i’ve done wrong here, please help.




Just don’t play sound effect too many at the same time.

if (reclaim.length >= this._maxAudioInstance) { cc.log("Error: " + path + " greater than " + this._maxAudioInstance); return path; }

The maxAudioInstance value is 10.