WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.05k stars 167 forks source link

Should the check on `process()` be removed from `AudioWorkletGlobalScope.registerProcessor()`? #2045

Closed karlt closed 4 years ago

karlt commented 5 years ago

From about https://github.com/WebAudio/web-audio-api/issues/1767#issuecomment-424687184, there was discussion about moving the check for process() out of registerProcessor().

https://github.com/WebAudio/web-audio-api/issues/1767#issuecomment-425165339 then resolved to add an IsCallable() check before calling process() in the rendering loop, and to "remove the redundant process() check in the instantiation of AWP".

There was no "process() check" in AudioWorkletProcessor instantiation, and the process() check in registerProcessor() is redundant now, so I wonder whether the intention was to remove the redundant check from registerProcessor()?

This would allow the client AudioWorkletProcessorConstructor to create the process() method in a way other than having it on the prototype, and would provide opportunity for reporting an error through AudioWorkletNode.onprocessorerror.

hoch commented 5 years ago

Sounds reasonable. I'll work on the text.