I need to work with audio, and I need to use the following line of code after creating an AudioContext:
audioContext.createScriptProcessor(4096, 1, 1);
Although this still works, I see that this is deprecated and replaced:
Deprecated
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Note: As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and was replaced by AudioWorklet (see AudioWorkletNode).
Source: https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode
I am unsure of how to rework this code using the AudioWorklet and AudioWorkletNode.
Additionally, onaudioprocess is deprecated. Thank you!