Skip to content

Instantly share code, notes, and snippets.

@kigiri
Created May 2, 2017 18:58
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kigiri/48752e826ab457823a81ebb403cdd1c3 to your computer and use it in GitHub Desktop.
Save kigiri/48752e826ab457823a81ebb403cdd1c3 to your computer and use it in GitHub Desktop.
// copy paste this in the console from youtube
const ctx = new AudioContext()
const L = ctx.createGain()
const R = ctx.createGain()
const splitter = ctx.createChannelSplitter(2)
ctx.createMediaElementSource($('video')).connect(splitter, 0, 0)
splitter.connect(L, 0)
splitter.connect(R, 1)
L.connect(ctx.destination, 0)
R.connect(ctx.destination, 0)
window.soundLevel = level =>
gainL.gain.value = gainR.gain.value = level
@alankyshum
Copy link

This perfectly solves problems with some videos!!! Thanks a lot!

@ahamza61
Copy link

Thank you! It works.

@Utshaw
Copy link

Utshaw commented Jun 8, 2020

It works but I can't increase or decrease the speed after pasting the code on console. Can you fix that ?

@kigiri
Copy link
Author

kigiri commented Jun 18, 2020

It works but I can't increase or decrease the speed after pasting the code on console. Can you fix that ?

Sorry @Utshaw no clues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment