Created
September 28, 2019 02:09
-
-
Save mr21/e11513ff8219ccf92fa1b088ed434f69 to your computer and use it in GitHub Desktop.
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
var vid = document.querySelector( "video" ); | |
var audioCtx = new AudioContext(); | |
var source = audioCtx.createMediaElementSource( vid ); | |
var compressor = audioCtx.createDynamicsCompressor(); | |
var now = audioCtx.currentTime; | |
compressor.threshold.setValueAtTime( -50, now ); | |
compressor.knee.setValueAtTime( 40, now ); | |
compressor.ratio.setValueAtTime( 32, now ); | |
compressor.attack.setValueAtTime( 0, now ); | |
compressor.release.setValueAtTime( .25, now ); | |
source.connect( compressor ); | |
compressor.connect( audioCtx.destination ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment