Add measured room EQ for Mini 2

This commit is contained in:
2026-11-11 21:39:29 +03:00
parent a318099add
commit c2a0a7bc2f
17 changed files with 1188 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
class RoomMic extends AudioWorkletProcessor {
constructor() {
super();
this.remaining = sampleRate * 15;
this.block = new Float32Array(4096);
this.offset = 0;
}
flush() {
const block = this.block.slice(0, this.offset);
this.port.postMessage(block, [block.buffer]);
this.offset = 0;
}
process(inputs) {
const mono = inputs[0]?.[0];
if (!mono || !this.remaining) return true;
const count = Math.min(mono.length, this.remaining);
for (let i = 0; i < count; i++) {
this.block[this.offset++] = mono[i];
if (this.offset === this.block.length) this.flush();
}
this.remaining -= count;
if (this.remaining === 0) {
if (this.offset) this.flush();
this.port.postMessage('done');
}
return true;
}
}
registerProcessor('room-mic', RoomMic);