Jump to content

Mobile Audio *Crash Bug*


brentstrandy
 Share

Recommended Posts

I have the following code to load all my Audio files

[
  'file1',
  'file2',
  'file3',
  'file4',
].forEach(element => {
  this.load.audio(element, 'sounds/' + element + '.mp3');
});

This works wonderfully on a desktop, but on mobile I get the following error:

TypeError: null is not an object (evaluating 'e.message')

The error occurs in AudioFile.js (Line 100). Here is an excerpt, I've added a comment where the error is thrown:


onProcess: function ()
{
    this.state = CONST.FILE_PROCESSING;

    var _this = this;

    this.config.context.decodeAudioData(this.xhrLoader.response,
        function (audioBuffer)
        {
            _this.data = audioBuffer;

            _this.onProcessComplete();
        },
        function (e)
        {
            // ERROR occurs on this line (e is null)
            console.error('Error decoding audio: ' + this.key + ' - ', e.message);

            _this.onProcessError();
        }
    );

    this.config.context = null;
}

 

Link to comment
Share on other sites

This is fixed in the master branch and will be part of the 3.12 release. However, it's only the error that is fixed - the cause of it is down to the device / browser / file format you're trying to load. When 3.12 is out the TypeError will be gone, but the files still won't load (as the source of the decodeAudioData error will still be there)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...