Skip to content

Instantly share code, notes, and snippets.

@zipcode
Created December 6, 2018 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zipcode/961ecb631bc89d498fccaa5c3331242b to your computer and use it in GitHub Desktop.
Save zipcode/961ecb631bc89d498fccaa5c3331242b to your computer and use it in GitHub Desktop.
reverb that video
ctx=new AudioContext();c=ctx.createConvolver();i=document.createElement("input");i.setAttribute("type","file");r=new FileReader();i.onchange=()=>r.readAsArrayBuffer(i.files[0]);r.onload=()=>{ctx.decodeAudioData(r.result,(b)=>{c.buffer=b;c.connect(ctx.destination);m=ctx.createMediaElementSource(document.querySelector("video"));m.connect(c)})};i.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment