goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
23.74k stars 2.22k forks source link

What might be the possible mistakes for onloaderror to trigger | help wanted #635

Closed chetansind closed 4 years ago

chetansind commented 7 years ago

I have used howler js to load audio files in IE 11, where I am not sure why it is triggering onloaderror.

What might the possible mistakes?

Please advise.

goldfire commented 7 years ago

What error are you getting? The second argument passed is the error message.

chetansind commented 7 years ago

I'm not getting any error message in the console but the howler object is not creating, and triggering on onloaderror event.

In onLoaderror event, first argument value i'm getting is 848677182230 (hope it is ID ) and second argument value is 4.

Not sure what these values are and how to resolve the problem using these values.

goldfire commented 7 years ago

That sounds like the file doesn't exist that you are trying to load. Can't really say more than that without seeing your actual code.

chetansind commented 7 years ago

Thank you for your prompt response.

I have all the audio files in a folder named Audios and same thing works in chrome, but in IE 11 browser I'm facing this issue.

Let me explain the scenario where im using howler. I'm trying to pre-load a set of audio files from array values using for loop. I am sharing the code snippet below, does this help?

for (j = 0; j < sounds.length; j = j + 1) {
    loadSound(sounds[j].name, sounds[j].src, soundsDone); //soundsDone - callback to check the loading progress
}

function loadSound(name, path, callback){
   sounds[name] = new Howl({
       src: [path],
       preload: true
   });

  sounds[name].once('load', function(){             
    console.log("Loaded sound: - " + path);                                 
    if(callback !== undefined){
        callback();
    }
   });

  sounds[name].once('loaderror', function(e, msg){  
    console.log('Unable to load file: ' + name + ' | error message : ' + msg);
        console.log('First argument error ' + e);
  });
}
goldfire commented 7 years ago

That error is coming from https://github.com/goldfire/howler.js/blob/master/src/howler.core.js#L1924. Are the demos on howlerjs.com working for you in IE11?

chetansind commented 7 years ago

What does the message code denote, as I'm getting second argument as 4?

I checked the demo url : http://www.javascriptoo.com/howler-js It is not working in IE 11 but it is working in chrome.

goldfire commented 7 years ago

The error code is from HTML5 Audio, it isn't a howler.js error code. That demo is using a very old version of howler.js. I'm referring to ones like https://howlerjs.com/#player or https://howlerjs.com/#sprite.

chetansind commented 7 years ago

Thanks for pointing it out. Will check with the latest version of howler 2.0.1 and get back to you.

danrostron commented 6 years ago

What's the latest with this. We're using 2.0.9, and its not loading audio files for us on IE11?

goldfire commented 6 years ago

@danrostron Can you provide some more details? We aren't having any issues with IE11 with audio on our games.

Chris-root commented 4 years ago

Hello,I have the same problem.All browsers is ok except IE,and the onloaderror returns error code 4. The version I use is 2.1.2

goldfire commented 4 years ago

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