Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. var vid = document.querySelector( "video" );
  2. var audioCtx = new AudioContext();
  3. var source = audioCtx.createMediaElementSource( vid );
  4. var compressor = audioCtx.createDynamicsCompressor();
  5. var now = audioCtx.currentTime;
  6.  
  7. compressor.threshold.setValueAtTime( -50, now );
  8. compressor.knee.setValueAtTime( 40, now );
  9. compressor.ratio.setValueAtTime( 32, now );
  10. compressor.attack.setValueAtTime( 0, now );
  11. compressor.release.setValueAtTime( .25, now );
  12.  
  13. source.connect( compressor );
  14. compressor.connect( audioCtx.destination );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement