AudioWorklets provide a nice way of synthesizing audio in the a background worker instead of the UI thread. It would be worth a test synthesizing the audio via worklet to avoid hanging audio in the UI.
Various things will need to be considered:
- How can we send custom messages from the worklet to the UI for synth events.
- Check if the worklet would only syntheiszes one buffer and buffering is done via nodes, or if the worklet would spawn another worker for synthesizing and do a custom buffering like the output today.
- AudioWorklets are only available in secure contexts and hence the old processor node still needs to be available in parallel.
AudioWorklets provide a nice way of synthesizing audio in the a background worker instead of the UI thread. It would be worth a test synthesizing the audio via worklet to avoid hanging audio in the UI.
Various things will need to be considered: