Last active
July 24, 2022 00:49
-
-
Save muzakparov/745738a8ea102ab79bf412d2dbace5f5 to your computer and use it in GitHub Desktop.
Youtube volume up
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
/*Quick code to increase YT volume*/ | |
// create an audio context and hook up the video element as the source | |
const myVideoElement = document.querySelector('video'); | |
const audioCtx = new AudioContext(); | |
const source = audioCtx.createMediaElementSource(myVideoElement); | |
// create a gain node | |
const gainNode = audioCtx.createGain(); | |
gainNode.gain.value = 5; // 5x the volume | |
source.connect(gainNode); | |
// connect the gain node to an output destination | |
gainNode.connect(audioCtx.destination); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment