danigb / soundfont-player

Quick soundfont loader and player for browser
MIT License
453 stars 60 forks source link

Can't get soundfont-player to work on Mac (Safari or Chrome) #81

Open nitzanrh opened 3 years ago

nitzanrh commented 3 years ago

After setting up the player I get this message via the console: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'ac.decodeAudioData') line 522

Anyone experienced this error and knows how to handle it?

Cheers, Nitzan

leocaseiro commented 3 years ago

I've just noticed that!

Same issue on Safari, but I can use on Chrome.

Have a look at the gh-page on Safari 14.1.1 on Mac 11.4 https://danigb.github.io/soundfont-player/

Screen Shot 2021-06-16 at 2 14 53 pm
sschmidTU commented 2 years ago

This might be a problem introduced with Safari 15. I'm also getting the EncodingError: Decoding failed and DecodeAudioData error. https://discussions.apple.com/thread/253182102 https://lzomedia.com/blog/safari-15-fails-to-decode-audio-data-that-previous-versions-decoded-without-problems/

Right now, i can't get audio on iOS/Safari to work. It works in Chrome and Firefox on a Macbook (same code obviously).

I even created and resumed the AudioContext right on a user click (which apparently you should do for Safari), but that didn't change anything.

Apparently you may have to use 2 different user clicks to first load audio data, then play it back: https://github.com/mdn/webaudio-examples/issues/5#issuecomment-664278053

hmoffatt commented 2 years ago

@sschmidTU confirmed as Safari bug on 10.15 in https://bugs.webkit.org/show_bug.cgi?id=230974

marian-simonca commented 2 years ago

Any updates on this problem? It's still not working for us on Safari 15.4 and it's a major problem. Did anyone find any solution for it?

hmoffatt commented 2 years ago

Did anyone find any solution for it?

Upgrade macOS - that same Safari version works on 11+. Or use another browser.

marian-simonca commented 2 years ago

macOS version is 12.3.1. Also, another browser won't help me since this is an application used by lots of users. We can't tell them 'use another browser' just like this. Thank you anyway!

kishansripada commented 2 years ago

Hi all! Here's a temporary solution you could request your users perform.

image

If they allow all auto play then the playback works no probelm

AlanPaine commented 1 year ago

I would like to ask, has this problem been solved after so long

danigb commented 1 year ago

This repository will be archived very soon. I'm not working anymore on it (since a long time). A possible alternative could be https://github.com/danigb/smplr that works on Safari (but have much less options)

AlanPaine commented 1 year ago

@sschmidTU Hello, sschmidTU soundfont - player cannot play in Safari can question whether you can use https://github.com/danigb/smplr to replace soundfont - player before osmd use lead to the problems

AlanPaine commented 1 year ago

This repository will be archived very soon. I'm not working anymore on it (since a long time). A possible alternative could be https://github.com/danigb/smplr that works on Safari (but have much less options)

@danigb It looks great. Thank you