What happens if an exception is thrown inside the worklet while processing audio? Anything? Nothing?
The issued is raised by @slightlyoff at #869.
Currently our spec does not have the process-invalidation process, but I am working on a PR for that. It will be similar to this: https://www.w3.org/TR/css-paint-api-1/#paint-invalidation
In short, if the validation fails for process() method (i.e. an exception thrown), the UA will invalidate the process call by marking it as 'invalid' and the processor will output silence (or bypass) afterward.
That leaves the question, silence or bypass ?
I think I lean towards silence:
A message in the developer tools
Not sure if this can be specced? I completely agree that UA needs to provide this.
Similar to PaintWorklet, AudioWorkletNode definition should have a validation flag. Any exception in the constructor() and process() method will flip this flag and the node will produce silence afterwards.
Just an informative note would do in this case, I suppose. Gecko logs thing in the dev console rather liberally when something happens that is not synchronously detectable (so we can't throw an exception right away), but hard to debug (for example, piping an HTMLMediaElement to an AudioContext that is not from the same origin and would produce silence).
Most helpful comment
That leaves the question, silence or bypass ?
I think I lean towards silence: