Created
January 14, 2016 23:14
-
-
Save robie1373/974261703e7dd8d49a4f to your computer and use it in GitHub Desktop.
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
<!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