Howler.js: IndexSizeError error in IE11

Created on 30 Jun 2017  路  9Comments  路  Source: goldfire/howler.js

it got below error in IE 11

SCRIPT5022: IndexSizeError
howler.min.js (2,18068)

Most helpful comment

Hi,

For me, this happened because I had created a Howl with a volume value of 1.5, like this:

var sound = new Howl({ src: ['sound.mp3'], volume: 1.5 });

It seems that any value above 1 will cause this error in IE 11.

Hope this helps.

All 9 comments

Do you have sample code? Not much to go off of otherwise.

I found the error happened below
(e._node = new Audio, e._errorFn = e._errorListener.bind(e), e._node.addEventListener("error", e._errorFn, !1), e._loadFn = e._loadListener.bind(e), e._node.addEventListener(n._canPlayEvent, e._loadFn, !1), e._node.src = o._src, e._node.preload = "auto", e._node.volume = t * n.volume(), e._node.load()), e;

I made something
`**(function () {
if ( typeof window.CustomEvent === "function" ) return false;
function CustomEvent ( event, params ) {

params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;

}

CustomEvent.prototype = window.Event.prototype;

window.CustomEvent = CustomEvent;
window.Event = CustomEvent;

})();**`

this is what i made change only for IE 11 to support customevent and event

return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):(e._node=new Audio,e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._node.src=o._src,e._node.preload="auto",e._node.volume=t*n.volume(),e._node.load()),e

I found the error, if I remove ## e._node.volume=t*n.volume(), from the above code I placed, it is working.

It looks like e._node.volume cause the error, when I log t*n.volume(). it is showing 10. is it 10 out of the range of e._node.volume?

this._sounds[id].sound = new Howl({ onload: sounds[id]["type"] === "music"?this.onAudioloaded.bind(this):null, autoplay: false, preload: true, volume: sounds[id]["volume"]*10, loop: sounds[id]["loop"], src: [sounds[id]["url"]] });

when you define volume more than 1 in IE 11 that is not webaudio. it will get error. I think for the code e._node.volume=tn.volume(), it should detect if tn.volume() is more than 1, otherwise it will be broken and get the SCRIPT5022: IndexSizeError

Hi,

For me, this happened because I had created a Howl with a volume value of 1.5, like this:

var sound = new Howl({ src: ['sound.mp3'], volume: 1.5 });

It seems that any value above 1 will cause this error in IE 11.

Hope this helps.

Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.

Was this page helpful?
0 / 5 - 0 ratings