chrisguttandin / standardized-audio-context

A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
MIT License
668 stars 33 forks source link

removeModule is missing #1001

Closed jonatanMelzer closed 1 year ago

jonatanMelzer commented 1 year ago

Hello Chris, I guess it's because I lack some knowledge, but IAudioWorklet interface doesn't offer removeModule. How can I avoid the following error? Uncaught DOMException: Failed to execute 'registerProcessor' on 'AudioWorkletGlobalScope': An AudioWorkletProcessor with name:"recorder-audio-worklet-processor" is already registered. thx and best regards

chrisguttandin commented 1 year ago

Hi @jonatanMelzer,

unfortunately there is no function to remove an already loaded module. The AudioWorkletGlobalScope is in the end not much different from any other JS context. Once a module is loaded it can't be removed anymore.

There was recently a related spec discussion. Maybe there is helpful information for you in there. https://github.com/WebAudio/web-audio-api/issues/2541