Motivation: #1193 (comment)
The propose IDL is:
enum AudioWorkletProcessorState {
"created",
"running",
"stopped",
"error"
};
interface AudioWorkletNode : AudioNode {
readonly attribute AudioParamMap parameters;
readonly attribute MessagePort port;
readonly attribute AudioWorkletProcessorState processorState;
attribute EventHandler onprocessorstatechange;
attribute EventHandler onprocessorerror;
}
In this way, user can inspect the current status of AWN more easily. More importantly, the construction of AWN/AWP is now asynchronous, thus the failure in the processor construction will notify the node via onerror
event handler and render the node inactive state, resulting the silent output.