Test copyFromChannel and copyToChannel

Tests what happens with copyFromChannel and copyToChannel when given arrays that are shorter or longer than the buffer array.

copyFromChannel

Basically tests what happens with

      let c = new AudioContext();
      let buffer = c.createBuffer(1, 8, c.sampleRate);
      let dest4 = new Float32Array(4);
      let dest16 = new Float32Array(16);
      dest4.fill(NaN);
      dest16.fill(NaN);

      buffer.copyFromChannel(dest4, 0);
      buffer.copyFromChannel(dest16, 0);
    

Check console logs to see if any errors were thrown and what the contents of dest4 and dest16 are.

copyToChannel

Like copyFromChannel, but in reverse.


Raymond Toy
Last modified: Fri Jan 6 11:56:05 PST 2017