Skip to content

Instantly share code, notes, and snippets.

@schovi
Last active October 27, 2023 19:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schovi/3aaa04e820a1abe18c7e9d491634b8d7 to your computer and use it in GitHub Desktop.
Save schovi/3aaa04e820a1abe18c7e9d491634b8d7 to your computer and use it in GitHub Desktop.
Small scripts to boost twitch volume beyond 100% or change brightness of video
// To use this, open console (developer tools), change the brigtness you want, paste it there and run
// 1 = 100% ...
twitchBrightness(1.2)
function twitchBrightness(amount) {
const video = document.querySelector('video')
video.style.filter = `brightness(${amount * 100}%)`
}
// To use this, open console (developer tools), change the volume you want, paste it there and run
// 1 = 100% ...
twitchVolume(2)
function twitchVolume(volume) {
if (!window.twitchVolumeGainNode) {
const video = document.querySelector('video')
// create an audio context and hook up the video element as the source
const audioCtx = new AudioContext();
const source = audioCtx.createMediaElementSource(video);
// create a gain node
const gainNode = audioCtx.createGain();
source.connect(gainNode);
// connect the gain node to an output destination
gainNode.connect(audioCtx.destination);
window.twitchVolumeGainNode = gainNode
}
window.twitchVolumeGainNode.gain.value = volume
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment