aboutsummaryrefslogtreecommitdiff
path: root/public/rnnoise
diff options
context:
space:
mode:
Diffstat (limited to 'public/rnnoise')
-rw-r--r--public/rnnoise/LICENSE21
-rw-r--r--public/rnnoise/rnnoise-processor.js41
-rw-r--r--public/rnnoise/rnnoise-processor.wasmbin124830 -> 0 bytes
-rw-r--r--public/rnnoise/rnnoise-runtime.js76
4 files changed, 0 insertions, 138 deletions
diff --git a/public/rnnoise/LICENSE b/public/rnnoise/LICENSE
deleted file mode 100644
index 4824556..0000000
--- a/public/rnnoise/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 WONG Tin Chi Timothy
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
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
- );
- }
- }
- );
-}
diff --git a/public/rnnoise/rnnoise-processor.wasm b/public/rnnoise/rnnoise-processor.wasm
deleted file mode 100644
index 86fea35..0000000
--- a/public/rnnoise/rnnoise-processor.wasm
+++ /dev/null
Binary files differ
diff --git a/public/rnnoise/rnnoise-runtime.js b/public/rnnoise/rnnoise-runtime.js
deleted file mode 100644
index f69c568..0000000
--- a/public/rnnoise/rnnoise-runtime.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-{
- const g = document.currentScript.src.match(/(.*\/)?/)[0],
- h = (
- WebAssembly.compileStreaming ||
- (async (a) => await WebAssembly.compile(await (await a).arrayBuffer()))
- )(fetch(g + "rnnoise-processor.wasm"));
- let k, c, e;
- window.RNNoiseNode =
- ((window.AudioWorkletNode ||
- (window.AudioWorkletNode = window.webkitAudioWorkletNode)) &&
- class extends AudioWorkletNode {
- static async register(a) {
- k = await h;
- await a.audioWorklet.addModule(g + "rnnoise-processor.js");
- }
- constructor(a) {
- super(a, "rnnoise", {
- channelCountMode: "explicit",
- channelCount: 1,
- channelInterpretation: "speakers",
- numberOfInputs: 1,
- numberOfOutputs: 1,
- outputChannelCount: [1],
- processorOptions: { module: k },
- });
- this.port.onmessage = ({ data: b }) => {
- b = Object.assign(new Event("status"), b);
- this.dispatchEvent(b);
- if (this.onstatus) this.onstatus(b);
- };
- }
- update(a) {
- this.port.postMessage(a);
- }
- }) ||
- ((window.ScriptProcessorNode ||
- (window.ScriptProcessorNode = window.webkitScriptProcessorNode)) &&
- Object.assign(
- function (a) {
- const b = a.createScriptProcessor(512, 1, 1),
- d = c.newState();
- let f = !0;
- b.onaudioprocess = ({ inputBuffer: b, outputBuffer: a }) => {
- f &&
- (e.set(b.getChannelData(0), c.getInput(d) / 4),
- (b = a.getChannelData(0)),
- (a = c.pipe(d, b.length) / 4) &&
- b.set(e.subarray(a, a + b.length)));
- };
- b.update = (a) => {
- if (f)
- if (a) {
- if (
- ((a = Object.assign(new Event("status"), {
- vadProb: c.getVadProb(d),
- })),
- b.dispatchEvent(a),
- b.onstatus)
- )
- b.onstatus(a);
- } else (f = !1), c.deleteState(d);
- };
- return b;
- },
- {
- register: async () => {
- c ||
- (e = new Float32Array(
- (c = (await WebAssembly.instantiate(await h))
- .exports).memory.buffer
- ));
- },
- }
- ));
-}