From 61950198e3bf06555f48e8f51c882a4c3cce5128 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 7 Sep 2022 11:14:42 +0200 Subject: REFACTOR! pt.1 --- public/rnnoise/rnnoise-processor.js | 41 ------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 public/rnnoise/rnnoise-processor.js (limited to 'public/rnnoise/rnnoise-processor.js') diff --git a/public/rnnoise/rnnoise-processor.js b/public/rnnoise/rnnoise-processor.js deleted file mode 100644 index 5b594a4..0000000 --- a/public/rnnoise/rnnoise-processor.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -{ - let b, d; - registerProcessor( - "rnnoise", - class extends AudioWorkletProcessor { - constructor(a) { - super({ - ...a, - numberOfInputs: 1, - numberOfOutputs: 1, - outputChannelCount: [1], - }); - b || - (d = new Float32Array( - (b = new WebAssembly.Instance(a.processorOptions.module) - .exports).memory.buffer - )); - this.state = b.newState(); - this.alive = !0; - this.port.onmessage = ({ data: a }) => { - this.alive && - (a - ? this.port.postMessage({ vadProb: b.getVadProb(this.state) }) - : ((this.alive = !1), b.deleteState(this.state))); - }; - } - process(a, c, e) { - if (!a[0][0]) return 1 - if (this.alive) - return ( - d.set(a[0][0], b.getInput(this.state) / 4), - (a = c[0][0]), - (c = b.pipe(this.state, a.length) / 4) && - a.set(d.subarray(c, c + a.length)), - !0 - ); - } - } - ); -} -- cgit v1.2.3-70-g09d2