| 21 | #endif |
| 22 | class WasmAudioWorkletProcessor extends AudioWorkletProcessor { |
| 23 | constructor(args) { |
| 24 | super(); |
| 25 | |
| 26 | // Capture the Wasm function callback to invoke. |
| 27 | let opts = args.processorOptions; |
| 28 | #if ASSERTIONS |
| 29 | assert(opts.callback) |
| 30 | assert(opts.samplesPerChannel) |
| 31 | #endif |
| 32 | this.callback = {{{ makeDynCall('iipipipp', 'opts.callback') }}}; |
| 33 | this.userData = opts.userData; |
| 34 | // Then the samples per channel to process, fixed for the lifetime of the |
| 35 | // context that created this processor. Even though this 'render quantum |