engine: Oculus Browser - Error loading audio url: : Unable to decode audio data

Description

  • Happens on Oculus Browser 17.0.0.6.22.318015459 (Chromium 93.0.4577.62) for Quest 2
  • Doesn’t happen on Windows 64-bit Chrome 93.0.4577.82
  • Doesn’t happen on Firefox Reality (12.2) for Quest 2
  • Different hosting doesn’t seem to make a difference (happens when self-hosted or internally hosted i.e. https://launch.playcanvas.com/xxxxxxx)
  • It only happens about 50% of the time (?)
  • The mp3 files can be inspected and played back fine from the Editor preview panel
  • The mp3 files I’ve tested are between 3-5mb and durations between 2-3 minutes.
  • I’ve tested many different mp3 files to ensure there are no file-specific issues.
  • I haven’t tested other audio encodings or formats.
  • The issue is highly, highly reproducible and is affecting our team (10+ users) on a daily basis.
  • I’m happy to provide more information if need be.

Steps to Reproduce

  1. Import any (?) mp3 file in a PlayCanvas project and set its preload flag to true.
  2. Alternatively, you can connect Chrome DevTools through ADB (guide) and call pc.app.assets.load(anyMP3Asset) through the console. This is preferred since you can also use anyMP3Asset.unload() to easily try again and inspect the error in detail.
  3. Launch the PlayCanvas application
  4. There is a very high likelihood of encountering the Unable to decode audio data error. If it doesn’t happen, simply refresh or unload/reload. It seems to be more likely to happen than less.
  5. The resulting error is internal to PlayCanvas and therefore ceases further execution of the app.

Error lines

If I follow the debug links found attached to the error in Chrome DevTools, it seems to originate from this line in the AudioHandler function (also pictured in the screenshots)

	var AudioHandler = function () {
		function AudioHandler(manager) {
			this.manager = manager;
			this.maxRetries = 0;
		}

		var _proto = AudioHandler.prototype;

		_proto._isSupported = function _isSupported(url) {
			var ext = path.getExtension(url);

			if (toMIME[ext]) {
				return true;
			}

			return false;
		};

		_proto.load = function load(url, callback) {
			if (typeof url === 'string') {
				url = {
					load: url,
					original: url
				};
			}

			var success = function success(resource) {
				callback(null, new Sound(resource));
			};

			var error = function error(err) {
				var msg = 'Error loading audio url: ' + url.original;

				if (err) {
					msg += ': ' + (err.message || err);
				}

				console.warn(msg);
				callback(msg); // < ----- This guy right here!
			};

			if (this._createSound) {
				if (!this._isSupported(url.original)) {
					error("Audio format for " + url.original + " not supported");
					return;
				}

				this._createSound(url.load, success, error);
			} else {
				error(null);
			}
		};

image image

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

Hmm, I wonder if it be worth trying to load and unload a bunch of MP3s will cause the same issue? If it does, maybe there’s s bug with unloading audio assets either in the engine or browser?

Tried it on an Android device with 12GB of RAM and that load the scene fine so its looking more to be a memory constraint.

If the MP3 is licensed, make it private and give ‘yaustar’ read access please.

Hm, this project doesn’t seem to cause the error for me either.

I’ll create an example project with the error and link it here shortly.