Skip to content

Instantly share code, notes, and snippets.

@beefchimi
Last active October 22, 2017 23:44
Show Gist options
  • Save beefchimi/4d91c126c716ace2b40b829c49f4e735 to your computer and use it in GitHub Desktop.
Save beefchimi/4d91c126c716ace2b40b829c49f4e735 to your computer and use it in GitHub Desktop.
Fade in gainNode
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