Closed karlt closed 3 years ago
If gather this issue correctly this means there is a significant difference in processing between
constructor() {
this.port.onmessage = e => {
// messages, data transferred immediately upon AudioWorkletNode()
}
}
and
constructor() {
this.port.onmessage = this.handMessage.bind(this);
}
handleMessage(e) {
// do stuff
}
as to when process()
is contructed begins processing inputs, outputs?
The instantiation of AudioWorkletProcessor algorithm sets the node reference and transferred port of the AudioWorkletGlobalScope's pending processor construction data.
Only the AudioWorkletProcessor() constructor arranges for this data to be cleared, but "Construct a callback function" in the instantiation of AudioWorkletProcessor does not necessarily invoke the AudioWorkletProcessor() constructor.
I assume that steps to "Empty the pending processor construction data slot" and "queue a task to the control thread to fire an event named processorerror" should be moved from the AudioWorkletProcessor() constructor to the instantiation of AudioWorkletProcessor algorithm?
Some more details are in https://github.com/WebAudio/web-audio-api/issues/2096, but perhaps all the details there occluded the core of the issue.