brentstrandy Posted July 23, 2018 Share Posted July 23, 2018 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 More sharing options...
rich Posted July 23, 2018 Share Posted July 23, 2018 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) brentstrandy 1 Link to comment Share on other sites More sharing options...
brentstrandy Posted July 23, 2018 Author Share Posted July 23, 2018 You're amazing. Thank you! Quote but the files still won't load (as the source of the decodeAudioData error will still be there) Hopefully the console log with provide more details. I'm loading MP3's - I thought this file type was compatible on mobile? Link to comment Share on other sites More sharing options...
rich Posted July 23, 2018 Share Posted July 23, 2018 No, there are lots of browsers that can't play mp3s I'm afraid. Link to comment Share on other sites More sharing options...
Recommended Posts