Skip to content

Instantly share code, notes, and snippets.

@icatalina
Created January 12, 2022 05:09
Show Gist options
  • Save icatalina/6c4b14b2d2ac2e70984daa2536067ef0 to your computer and use it in GitHub Desktop.
Save icatalina/6c4b14b2d2ac2e70984daa2536067ef0 to your computer and use it in GitHub Desktop.
AudioDelay HTML
stop = async () => {
await window.context?.suspend();
media.getTracks().forEach(track => track.stop())
};
await stop();
media = await navigator.mediaDevices.getUserMedia({
audio: {
noiseSuppression: true,
echoCancellation: true,
}
})
context = new AudioContext();
media = await navigator.mediaDevices.getUserMedia({
audio: {
}
})
source = context.createMediaStreamSource(media)
delay = new DelayNode(context, {
delayTime: 0.4,
});
stream = source
.connect(delay)
.connect(context.destination);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment