Skip to content

Instantly share code, notes, and snippets.

@neopunisher
Created May 24, 2018 04:00
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 neopunisher/3a26988e2fe9c7223facf6d52ec74b4f to your computer and use it in GitHub Desktop.
Save neopunisher/3a26988e2fe9c7223facf6d52ec74b4f to your computer and use it in GitHub Desktop.
put on headphones and try and talk
var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioContext = new AudioContext();
var synthDelay = audioContext.createDelay(0.2);
synthDelay.connect(audioContext.destination)
// request audio stream from the user's webcam
navigator.mediaDevices.getUserMedia({
audio: true
})
.then(function (stream) {
var mediaStreamNode = audioContext.createMediaStreamSource(stream);
mediaStreamNode.connect(synthDelay);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment