Skip to content

Instantly share code, notes, and snippets.

@robie1373
Created January 14, 2016 23:14
Show Gist options
  • Save robie1373/974261703e7dd8d49a4f to your computer and use it in GitHub Desktop.
Save robie1373/974261703e7dd8d49a4f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
</head>
<body>
</body>
</html>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillator = audioCtx.createOscillator();
oscillator.type = "sine";
oscillator.frequency.value = 622;
buffer = audioCtx.createBuffer(1, 3, audioCtx.sampleRate);
//???? What do I do here to get the buffer to contain 1 second of tone, 1 second of silence, and 1 second of tone?
bufferSource = audioCtx.createBufferSource();
bufferSource.connect(audioCtx.destination)
bufferSource.start();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment