Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mehmetbebek/5bb5eac97898389b533ee0adb427eb40 to your computer and use it in GitHub Desktop.
Save mehmetbebek/5bb5eac97898389b533ee0adb427eb40 to your computer and use it in GitHub Desktop.
Sesi Streo Yapmak
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment