Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioContext.decodeAudioData() fails with 'EncodingError: Decoding failed' error #1513

Open
leshak2k opened this issue Aug 27, 2021 · 13 comments

Comments

@leshak2k
Copy link

Safari 15 beta 4 @ MacOS Catalina v10.15.7

The following code fails to play mp3 audio file with EncodingError: Decoding failed error:

  loadAudioWithHowler() {
    const audio = new Howl({
      src: 'https://bug2report.s3.amazonaws.com/popup.mp3',
      preload: false,
      html5: false,
    })
      .on('load', () => {
        console.log(`+++ loaded`);
      })
      .on('loaderror', (id, message) => {
        console.log(`+++ error -> ${message}`);
      });

    audio.load();
  }

Corresponding howler.core.js function with added error parameter:

...
  var decodeAudioData = function(arraybuffer, self) {
    // Fire a load error if something broke.
    var error = function(error) {
      self._emit('loaderror', null, `Decoding audio data failed: ${error}`);
    };

    // Load the sound on success.
    var success = function(buffer) {
      if (buffer && self._sounds.length > 0) {
        cache[self._src] = buffer;
        loadSound(self, buffer);
      } else {
        error();
      }
    };

    // Decode the buffer into an audio source.
    if (typeof Promise !== 'undefined' && Howler.ctx.decodeAudioData.length === 1) {
      Howler.ctx.decodeAudioData(arraybuffer).then(success).catch(error);
    } else {
      Howler.ctx.decodeAudioData(arraybuffer, success, error);
    }
  }
...
@slahav
Copy link

slahav commented Sep 1, 2021

+1 Bump

@evanestal
Copy link

Would also like to see this resolved. +1

@thebarge
Copy link

thebarge commented Sep 1, 2021

👀 following +1

@slahav
Copy link

slahav commented Sep 3, 2021

FYI for everybody following. Apple confirmed this is an issue on their end, and are working to resolve it. Sadly they won't be able to resolve it before their imminent release, so it will be a patch fic post the release.

@dheimoz
Copy link

dheimoz commented Sep 10, 2021

@slahav I wonder if you could post the source where Apple stated that.
Thanks.

@damrbaby
Copy link
Contributor

We had to switch to html5 audio in desktop Safari 15 as a work-around (using html5: true). There does not seem to be a way to distinguish Safari 15 on Catalina from Big Sur, and the issue is only present on Catalina.

@BernsteinA
Copy link

@goldfire was this fixed in v2.2.3 with #1476 ? #1476 (comment)

@goldenratio
Copy link

goldenratio commented Oct 29, 2021

Seems to happen even in Safari 15.1 beta
any ideas on this? also do we have safari bug issue to track?

@tanzopen
Copy link

tanzopen commented Nov 1, 2021

According to Bugzilla this issue should be already patched in https://bugs.webkit.org/show_bug.cgi?id=230974
Strangely i'm with Safari 15.1 on Catalina 10.15.7 ( official ) and the issue still persists so either patch is not included or it is not working at all ...

I don't see any audio related notes in : https://support.apple.com/en-us/HT212875

There are two duplicates of the issue that highlights the mp3 decoding issue
https://bugs.webkit.org/show_bug.cgi?id=231449
https://bugs.webkit.org/show_bug.cgi?id=231872

@tfulpeducationguy
Copy link

Seems to happen even in Safari 15.1 beta any ideas on this? also do we have safari bug issue to track?

+1 bump

@goldfire
Copy link
Owner

There doesn't look to be anything that can be done on howler's end to resolve this. Leaving this open for now though so we can continue to track the webkit issue that @tanzopen listed until the fix lands in the released version of Safari on Catalina.

@tanzopen
Copy link

🎉 Good news - on Safari 15.4 MacOS Catalina v10.15.7 there is no more issue(s) with decoding ...

This ticket is now obsolete

@llibdude
Copy link

I'm on
MacOS Monterey 12.3.1
Safari 15.4 (17613.1.17.1.13)

And I am still experiencing this exact issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests