Skip to content

Instantly share code, notes, and snippets.

@jsantell
Created October 22, 2013 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsantell/7105867 to your computer and use it in GitHub Desktop.
Save jsantell/7105867 to your computer and use it in GitHub Desktop.
Reproduction case for changing oscillator type implementation, Bug 929621 https://bugzilla.mozilla.org/show_bug.cgi?id=929621
var TYPES = ['sine', 'sawtooth','triangle', 'square'];
var ctx = new (window.AudioContext || window.webkitAudioContext)();
var osc = ctx.createOscillator();
var t = 0;
osc.connect(ctx.destination);
osc.start(0);
setInterval(function () { osc.type = TYPES[t++ % TYPES.length]; }, 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment