Skip to content

Instantly share code, notes, and snippets.

@robertlong
Created December 1, 2017 23:06
Show Gist options
  • Save robertlong/572671a7d2306670f5a995f7e01238a1 to your computer and use it in GitHub Desktop.
Save robertlong/572671a7d2306670f5a995f7e01238a1 to your computer and use it in GitHub Desktop.
const ctx = new AudioContext();
function createMediaStream() {
const mediaStream = new MediaStream();
const source = ctx.createMediaStreamSource(mediaStream);
source.connect(ctx.destination);
setTimeout(() => {
console.log("disconnecting");
source.disconnect();
}, 3000);
}
setInterval(createMediaStream, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment