Ajout du sampler et de l'input

This commit is contained in:
2025-10-11 22:48:09 +02:00
parent 7f150e8bb4
commit 00e8b4a3a5
23 changed files with 1048 additions and 46 deletions

View File

@ -0,0 +1,31 @@
import type { AudioProcessor } from "./AudioProcessor";
export class StereoWidener implements AudioProcessor {
getName(): string {
return "Stereo Widener";
}
getDescription(): string {
return "Expands stereo field using mid-side processing";
}
async process(
leftChannel: Float32Array,
rightChannel: Float32Array
): Promise<[Float32Array, Float32Array]> {
const widthFactor = 1.5 + Math.random() * 1.5;
const newLeft = new Float32Array(leftChannel.length);
const newRight = new Float32Array(rightChannel.length);
for (let i = 0; i < leftChannel.length; i++) {
const mid = (leftChannel[i] + rightChannel[i]) * 0.5;
const side = (leftChannel[i] - rightChannel[i]) * 0.5 * widthFactor;
newLeft[i] = mid + side;
newRight[i] = mid - side;
}
return [newLeft, newRight];
}
}