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

Replace the deprecated ScriptProcessorNode with AudioWorkletNode #1281

Closed
thijstriemstra opened this issue Dec 22, 2017 · 25 comments · Fixed by #2706
Closed

Replace the deprecated ScriptProcessorNode with AudioWorkletNode #1281

thijstriemstra opened this issue Dec 22, 2017 · 25 comments · Fixed by #2706

Comments

@thijstriemstra
Copy link
Contributor

thijstriemstra commented Dec 22, 2017

ScriptProcessorNode is deprecated from the specification and replaced with AudioWorklet in Chrome 64. AudioWorklet is enabled by default for Chrome 66 or later. In Chrome 64 and 65, the feature is behind the experimental flag.

See https://developers.google.com/web/updates/2017/12/audio-worklet and even better: https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern

@thijstriemstra
Copy link
Contributor Author

There's now also a polyfill available: https://github.com/GoogleChromeLabs/audioworklet-polyfill

@thijstriemstra
Copy link
Contributor Author

This looks promising as well: https://github.com/chrisguttandin/standardized-audio-context

@sundayz
Copy link
Contributor

sundayz commented Aug 6, 2020

I came across AudioWorklets earlier today. From what I understand they could be used to play audio in a separate thread, so audio processing will never cause the UI to lag? I’m definitely going to look into this but I may need some help from people who know the web audio api better than me :)

@thijstriemstra
Copy link
Contributor Author

From what I understand they could be used to play audio in a separate thread, so audio processing will never cause the UI to lag?

That's also my understanding yea.

@entonbiba
Copy link
Contributor

@sundayz
Copy link
Contributor

sundayz commented May 10, 2021

Hi! iOS 14.5 is now released, which brings unprefixed WebAudio AND AudioWorklet support to Safari. Make sure to check that out. I guess in the future we will focus on AudioWorkletNode and provide ScriptProcessorNode as a fallback for iOS 14.4 and below (detected by webkit perfix WebAudio)

@cameronSlupeiks
Copy link

Has any progress been made in regards to adding support for AudioWorkletNode?

@dvantage
Copy link

dvantage commented Nov 8, 2021

I'm waiting for an update, for music services very important support for AudioWorkletNode

@thijstriemstra
Copy link
Contributor Author

Please consider sponsoring one of the developers to implement this feature.

@entonbiba
Copy link
Contributor

@dvantage @cameronSlupeiks this will take a bit of time to implement properly.

@sundayz if we do update to audioworkletnode we have to keep in mind using it will require a secure context making wavesurfer only work properly if its from a https resource when using webaudio.

window.isSecureContext is currently being reviewed as a feature candidate to provide a true or false if a page is in a secure context so this would likely have to be implemented when it's available as a way to detect and display a message. For now checking the host url being https would be sufficient.

@TheBoringBOT
Copy link

@entonbiba any update on this?

@Yan-vibeit
Copy link

Any update on this. This issue has existed for well over a year with seemingly no progress or evidence that Wavesurfer intends to adopt this.

@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Feb 15, 2023

Please consider sponsoring one of the developers to implement this feature.

I think this would be an excellent opensource or sponsors contribution.

@entonbiba
Copy link
Contributor

@Yan-vibeit I'll have a look at this again in the upcoming weeks see what's possible to implement it.

@entonbiba entonbiba self-assigned this Feb 25, 2023
@Yan-vibeit
Copy link

Yan-vibeit commented Feb 25, 2023 via email

@jgentes
Copy link
Sponsor Contributor

jgentes commented Feb 26, 2023

I think this issue was closed accidentally - it should remain open unless tracked elsewhere, no?

@katspaugh
Copy link
Owner

katspaugh commented Feb 26, 2023

Feel free to reopen it, but the issue has been there for 5 years w/o any progress made, so I don't see the point of tracking it.
If someone wants to add support for AudioWorklet, they can just open a PR.
Issues are for actionable items that will be definitely worked on, and for bug reports.

Edit: reopened and clarified the title.

@katspaugh katspaugh reopened this Feb 26, 2023
@katspaugh katspaugh changed the title Support for AudioWorklet Replace the deprecated ScriptProcessorNode with AudioWorkletNode Feb 26, 2023
@katspaugh
Copy link
Owner

@jgentes thanks for sponsoring btw! ❤️
I guess you're interested in this particular issue to be worked on?

@jgentes
Copy link
Sponsor Contributor

jgentes commented Feb 26, 2023

You're welcome @katspaugh - this is certainly the one I am most interested in, but no, I just thought it was reasonable to send $1/mo your way for making such a great library. I'm using it for a personal project: https://github.com/jgentes/mixpoint

@katspaugh
Copy link
Owner

Awesome!

@sandokan815
Copy link

So, what is final the solution to remove this warning in wavesurfer.js?

@katspaugh
Copy link
Owner

@sandokan815 the easiest is to just use backend: “MediaElement” if you don’t need any webaudio features.

Btw, ScriptProcessorNode seems to be used only for tracking the playback position when using the WebAudio backend. Should be fairly straightforward to replace.

@robots4life
Copy link

So get rid of the warning it is best to just use backend: “MediaElement” all the time, correct ?

@katspaugh
Copy link
Owner

katspaugh commented Apr 4, 2023

This warning will be gone completely in the next release. Edit: it's now live in 6.6.3.

But yeah, backend: “MediaElement” will also get rid of it.

@robots4life
Copy link

I can confirm the warning is gone with setting backend: "MediaElement".

webaudio.js:238 [Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)

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

Successfully merging a pull request may close this issue.