Last active
August 12, 2024 09:48
-
-
Save matiaslopezd/e715c9b5e69d4dbadb05027e11740ca7 to your computer and use it in GitHub Desktop.
Amplify audio/video source Javascript
This file contains hidden or 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
function amplify(node, gain) { | |
const audioCtx = new AudioContext(); | |
const source = audioCtx.createMediaElementSource(node); | |
// create a gain node | |
const gainNode = audioCtx.createGain(); | |
gainNode.gain.value = gain; | |
source.connect(gainNode); | |
// connect the gain node to an output destination | |
gainNode.connect(audioCtx.destination); | |
} |
This file contains hidden or 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
function amplify(node,gain){const audioCtx=new AudioContext();const source=audioCtx.createMediaElementSource(node);const gainNode=audioCtx.createGain();gainNode.gain.value=gain;source.connect(gainNode);gainNode.connect(audioCtx.destination)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Amplify audio or video
This
script
was used to amplifying the audio of videos on Netflix, HBO Max, Disney+, and Amazon Prime Video. The main reason to do it by Javascript and not by browser extension is that you cast a movie to the speaker like Google Home the volume could be low.Below you will see how to use it in the most common platforms, but obviously, this could use it for other purposes.
How to use
amplify.min.js
oramplify.js
.ctrl + shift + i
(Windows, Linux, etc) orcommand + Option + j
or right click and select Inspect.Console
and paste the codeConsole
and press EnterBy default the code will amplify 2 times the volume
Caution: Not recommended set volume more than 5, could damage speakers or headphones.
Netflix, Disney+ and HBO Max
Prime Video
Example in Netflix