GoogleChromeLabs/audioworklet-polyfill

'AudioWorkletProcessor.port' is undefined

Closed this issue · 1 comments

For example, doing this in:

class MyWorkletProcessor extends AudioWorkletProcessor
{
    constructor()
    {
        super();
        this.port.onmessage = (e) => ...
    }
}

Will result in an error, because this.port is undefined.

(I hate to be picky, but did anyone actually test this project? Really doesn't seem so, virtually everything is broken in it...)

The port is assigned, it's just done after construction. I'll move it into the constructor so that your example works.