smplr icon indicating copy to clipboard operation
smplr copied to clipboard

Doesn't work (no sound) in mobile Safari and Chrome

Open bobahvas opened this issue 10 months ago • 6 comments

I am trying to play midi notes. And it works well in the desktop version of Chrome and Safari

However, it doesn't work in the mobile versions of Chrome and Safari.

I tried load.then, all hooks like onStart. All of the successfully executed but there is no sound.

The simplest way to test - open an old issue from mobile phone https://github.com/danigb/smplr/issues/4

https://jsfiddle.net/k4Lodqmc/1/

bobahvas avatar Apr 18 '24 12:04 bobahvas

https://danigb.github.io/smplr/ seems to work on my (android) device. What is the problem exactly?

danigb avatar Apr 22 '24 14:04 danigb

https://danigb.github.io/smplr/ seems to work on my (android) device. What is the problem exactly?

@danigb just no sound on your page as well. I forgot to say (but you can see that I mentioned SafariI) that I tested with iPhone 14 Pro Max, iPhone 12, and iPhone 11 Pro Max (the latest iOS on each device)

However, the sustained test works great. Drums work well, all keyboard instruments don't work on click (tap, maybe this is the issue)

Sometimes I see this in the Safari console image

Note: it will not work in silent mode (dedicated iPhone button) even if you increase the volume (this is fine but can confuse)

bobahvas avatar Apr 22 '24 14:04 bobahvas

I have a similar problem. I built a progressive web app and installed it with Google Chrome on an iPhone 13 mini with IOS 17.5.1. When I try to play a melody, only a few notes are played, some are missing. The same app works well on Linux and Windows with different browsers.

zoschfrosch avatar Aug 07 '24 10:08 zoschfrosch

Hey, I'd like to understand this problem better. Can you provide some source code to reproduce? Does it happen on any other Apple devices? (Safari I'm looking at you) Have you tried to use standarized-audio-context?

Thanks

danigb avatar Aug 10 '24 19:08 danigb

I tried to develop a small test application to reproduce the error. For that, I modified your simple example in the README to play a sequence of notes. It works fine in Safari and Google Chrome on my iPhone. Then I tested again my App. It's developed and built with Quasar and VueJS 3. As development is going on, it is not exactly the same code where the problem occured. I tried the new version on my iPhone, and surprise - the problem disappeared.

I do not use the standardized-audio-context. Should I?

Kind regards Thomas

zoschfrosch avatar Aug 11 '24 11:08 zoschfrosch

Hi!

So, if I understand currently, now it works, right?

I do not use the standardized-audio-context. Should I?

It helps with compatibility problems between browsers, specifically with oddities of the Apple browsers. So, I think it should be a first thing to try (there's a section on README)

Thanks for checking and explanations!

danigb avatar Aug 13 '24 07:08 danigb