Last active
January 5, 2019 13:59
-
-
Save mashiro/51749cb64225fe3cac06f843f20f61f0 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
const gain = ((el) => { | |
const ctx = new window.AudioContext(); | |
const source = ctx.createMediaElementSource(el); | |
const gain = ctx.createGain(); | |
source.connect(gain); | |
gain.connect(ctx.destination) | |
return (multiplier) => { gain.gain.value = Math.min(multiplier, 10); }; | |
})(document.querySelector("video")); | |
gain(2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment