Created
January 12, 2022 05:09
-
-
Save icatalina/6c4b14b2d2ac2e70984daa2536067ef0 to your computer and use it in GitHub Desktop.
AudioDelay HTML
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
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