mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 01:39:29 +08:00
Add audio fade to remove audible 'pop' within sine's sound-on-click (#3895) jerryzhou196
* added audio fade * removed accidental space * lowered fadeout time Co-authored-by: Miodec <jack@monkeytype.com>
This commit is contained in:
parent
89024555a9
commit
d342a08d8e
1 changed files with 2 additions and 1 deletions
|
|
@ -374,7 +374,8 @@ export function playNote(
|
|||
|
||||
oscillatorNode.frequency.value = currentFrequency;
|
||||
oscillatorNode.start(audioCtx.currentTime);
|
||||
oscillatorNode.stop(audioCtx.currentTime + 0.15);
|
||||
gainNode.gain.setTargetAtTime(0, audioCtx.currentTime, 0.15); //remove click sound
|
||||
oscillatorNode.stop(audioCtx.currentTime + 0.5);
|
||||
}
|
||||
|
||||
export function playClick(): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue