Last active
August 27, 2024 10:04
-
-
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
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
// 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}%)` | |
} |
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
// 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
does not work on a js embedded stream.