Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const recordNode = audioContext.createScriptProcessor(bufferSize, 2, 2);
  2.  
  3. // an array for each channel
  4. const recording = [[], []];
  5.  
  6. // note: we are filling recording with `chunks` here, so
  7. // the chunks would need to be reassembled into a single buffer when you're ready to export
  8. recordNode.onaudioprocess = ((e) => {
  9.   recording[0].push(new Float32Array(e.inputBuffer.getChannelData(0)));
  10.   recording[1].push(new Float32Array(e.inputBuffer.getChannelData(1)));
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement