Skip to content

Instantly share code, notes, and snippets.

@muzakparov
Last active July 24, 2022 00:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muzakparov/745738a8ea102ab79bf412d2dbace5f5 to your computer and use it in GitHub Desktop.
Save muzakparov/745738a8ea102ab79bf412d2dbace5f5 to your computer and use it in GitHub Desktop.
Youtube volume up
/*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