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

Playback of the audioworklets version doesn't work in Safari 14.1 #646

Closed
2 of 6 tasks
Reiji777 opened this issue Aug 14, 2021 · 2 comments · Fixed by #652
Closed
2 of 6 tasks

Playback of the audioworklets version doesn't work in Safari 14.1 #646

Reiji777 opened this issue Aug 14, 2021 · 2 comments · Fixed by #652
Assignees
Labels
area-player Related to the audio playback engine. platform-javascript Related to the JavaScript version of alphaTab state-needs-investigation type-bug 🕷️

Comments

@Reiji777
Copy link

Reiji777 commented Aug 14, 2021

Expected Results

Playback works for all devices

Observed Results

As I am testing the latest audioworklets implementation, the playback function is not working in Safari 14.1 on iPhone or Mac.
When clicking on the play button, the playback won't occur; instead it returns an error:

unhandled Promise Rejection: InvalidStateError: No ScriptProcessor was registered with this name

The error is pointing to alphaTab.js:26188, which is the following code in the AlphaSynthAudioWorkletOutput class

this._worklet = new AudioWorkletNode(ctx, 'alphatab');

On other devices I have tested so far (Android phone, Safari Preview 15.0 / Chrome on Mac), the playback works with no problem

Steps to Reproduce

Link to jsFiddle, CodePen, Project etc.: https://jsbin.com/budozuf/

  1. Open the link in Safari on iPhone or Mac
  2. Click on the play button

Further details

Your environment

Version

  • 1.0
  • 1.1
  • 1.2
  • 1.3-alpha.127

Flavor

  • JavaScript
  • .net

System

iPhone X (iOS 14.6); Safari 14.1.1
Macbook (Big Sur 11.4); Safari 14.1.1

@Reiji777 Reiji777 changed the title Playback doesn't work on iPhone in the audioworklets version Playback doesn't work in Safari 14.1 in the audioworklets version Aug 15, 2021
@Reiji777 Reiji777 changed the title Playback doesn't work in Safari 14.1 in the audioworklets version Playback of the audioworklets version doesn't work in Safari 14.1 Aug 15, 2021
@Danielku15 Danielku15 added area-player Related to the audio playback engine. platform-javascript Related to the JavaScript version of alphaTab state-needs-investigation labels Aug 15, 2021
@Danielku15
Copy link
Member

I just quickly looked at the behavior of Safari and it is really strange. It is resolving the promise of addModule, but it does not execute any code of the loaded file resulting in no audio worklet processor being registered. It will likely need a bit longer to dig deeper here and find out why safari is not calling the worklet code.

@Danielku15
Copy link
Member

Found the issue and was able to fix it. Looks like Safari missed some parts when implementing AudioWorklets and I was able to work around it. Was quite nasty to find because they did not add any proper support for debugging or logging to Safari. All errors are swallowed and no custom logs are displayed. This made it really hard to find out why things are not working.

@Danielku15 Danielku15 added this to the [v1.3.0] Audio Worklets milestone Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-player Related to the audio playback engine. platform-javascript Related to the JavaScript version of alphaTab state-needs-investigation type-bug 🕷️
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants