buffers can now be repitched (still with aliasing)

This commit is contained in:
Felix Roos 2025-06-08 14:43:23 +02:00
parent 356d4360ec
commit 55aef18851
No known key found for this signature in database
3 changed files with 21 additions and 17 deletions

View file

@ -10,10 +10,10 @@ class DoughProcessor extends AudioWorkletProcessor {
if (event.data.spawn) {
this.dough.scheduleSpawn(event.data.spawn);
} else if (event.data.sample) {
this.dough.loadSample(event.data.sample, event.data.channels);
this.dough.loadSample(event.data.sample, event.data.channels, event.data.sampleRate);
} else if (event.data.samples) {
event.data.samples.forEach(([name, channels]) => {
this.dough.loadSample(name, channels);
event.data.samples.forEach(([name, channels, sampleRate]) => {
this.dough.loadSample(name, channels, sampleRate);
});
} else {
console.log('unrecognized event type', event.data);