Last active
October 22, 2017 23:44
-
-
Save beefchimi/4d91c126c716ace2b40b829c49f4e735 to your computer and use it in GitHub Desktop.
Fade in gainNode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const duration = 0.2; | |
const volume = { | |
min: 0.001, | |
max: 1, | |
}; | |
gainNode.gain.setValueAtTime( | |
volume.min, | |
context.currentTime | |
); | |
gainNode.gain.exponentialRampToValueAtTime( | |
volume.max, | |
context.currentTime + duration | |
); | |
oscNode.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment