Skip to content

Commit 12ff9c8

Browse files
author
Thomas Dodds
committed
fixes processor bug
1 parent 4560f2d commit 12ff9c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: examples/example_pitchbend/assets/processor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ class MyProcessor extends SuperpoweredWebAudio.AudioWorkletProcessor {
3131
processAudio(inputBuffer, outputBuffer, buffersize, parameters) {
3232
if (this.pitchBend) {
3333
this.player.pitchBend(this.pitchBend.maxPercent, this.pitchBend.bendStretch, this.pitchBend.faster, this.pitchBend.holdMs);
34+
this.cancelledPitchBend = false;
3435
} else if (!this.cancelledPitchBend) {
3536
this.player.endContinuousPitchBend();
37+
this.cancelledPitchBend = true;
3638
}
37-
this.cancelledPitchBend = !this.cancelledPitchBend;
3839
this.currentPitchBend = this.player.getCurrentPitchBendPercent();
3940
this.currentPitchBendMsOffset = this.player.getBendOffsetMs();
4041
if (!this.player.processStereo(outputBuffer.pointer, false, buffersize, 1)) this.Superpowered.memorySet(outputBuffer.pointer, 0, buffersize * 8);

0 commit comments

Comments
 (0)