init
This commit is contained in:
247 files changed
+35538
No files matched your search
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
class PlaybackProbe extends AudioWorkletProcessor {
|
||||
constructor() { super(); this.count = 0; this.energy = 0; }
|
||||
process(inputs) {
|
||||
for (const value of inputs[0]?.[0] || []) { this.energy += value * value; this.count++; }
|
||||
if (this.count >= 4800) { this.port.postMessage({ samples: this.count, energy: this.energy }); this.count = 0; this.energy = 0; }
|
||||
return true; // Output remains silence.
|
||||
}
|
||||
}
|
||||
registerProcessor('playback-probe', PlaybackProbe);
|
||||
Reference in new issue
Block a user