MCPcopy Create free account
hub / github.com/PaulBatchelor/Trio / constructor

Method constructor

web/processor.js:2–18  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1class TrioProcessor extends AudioWorkletProcessor {
2 constructor(options) {
3 super(options);
4 const wasmBytes = options.processorOptions.wasmBytes;
5
6 const mod = new WebAssembly.Module(wasmBytes);
7 this.wasm = new WebAssembly.Instance(mod, {});
8
9 this.dsp = this.wasm.exports.newdsp(sampleRate);
10 this.outptr = this.wasm.exports.alloc(128);
11 this.outbuf = new Float32Array(
12 this.wasm.exports.memory.buffer,
13 this.outptr,
14 128
15 );
16 this.port.onmessage =
17 (event) => this.onmessage(event.data);
18 }
19
20 process(inputs, outputs, parameters) {
21 const output = outputs[0];

Callers

nothing calls this directly

Calls 1

onmessageMethod · 0.95

Tested by

no test coverage detected