Skip to content

Instantly share code, notes, and snippets.

@beefchimi
Last active October 22, 2017 23:43
Show Gist options
  • Save beefchimi/c37672189a7b029b5ffd981ba3662615 to your computer and use it in GitHub Desktop.
Save beefchimi/c37672189a7b029b5ffd981ba3662615 to your computer and use it in GitHub Desktop.
Basic oscillator
const context = new AudioContext();
const oscNode = context.createOscillator();
const gainNode = context.createGain();
oscNode.connect(gainNode);
gainNode.connect(context.destination);
oscNode.start();
oscNode.stop(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment