summaryrefslogtreecommitdiffstats
path: root/dom/worklet/tests/worklet_audioWorklet.js
blob: fa916d4359b35615c1fb97650ed84f98b5e16a8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class DummyProcessWorkletProcessor extends AudioWorkletProcessor {
  constructor() {
    super();
  }

  process() {
    // Do nothing, output silence
  }
}

// We need to pass a valid AudioWorkletProcessor here, otherwise, it will fail,
// and the console.log won't be executed
registerProcessor("sure!", DummyProcessWorkletProcessor);
console.log(
  globalThis instanceof AudioWorkletGlobalScope ? "So far so good" : "error"
);