Skip to content

Commit

Permalink
Removed clicking
Browse files Browse the repository at this point in the history
only on chrome because damnit firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1308431)
  • Loading branch information
spessasus committed Aug 9, 2023
1 parent 6a2b6c5 commit 38a8d35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/spessasynth_lib/synthetizer/buffer_voice/sample_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ export class SampleNode
{
// stop the audio envelope
clearTimeout(this.timeout);
this.volumeController.gain.cancelScheduledValues(this.currentTime);
if(this.volumeController.gain.cancelAndHoldAtTime) {
this.volumeController.gain.cancelAndHoldAtTime(this.currentTime);
}
else
{
// firefox >:(
this.volumeController.gain.cancelScheduledValues(this.currentTime + 0.000001);
}
this.source.stop(this.source.context.currentTime + this.releaseTime);

// begin release phase
Expand Down

0 comments on commit 38a8d35

Please sign in to comment.