title: how can I reverse playback in web audio API but keep a forward version as well?
body: <p>To my knowledge, the Web Audio API in google Chrome (v21) does not support the following:</p>
  
  <pre><code>    source.playbackRate.value = -1; 
  </code></pre>
  
  <p>I very much wish! I will be patient, but in the meantime, <a href="https://stackoverflow.com/questions/9874167/how-can-i-play-audio-in-reverse-with-web-audio-api">this post</a> has a nice alternative solution.  I have adopted it to try and reverse my own audio samples loaded from a <a href="http://code.google.com/p/chromium/source/browse/trunk/samples/audio/doc/loading-sounds.html" rel="nofollow noreferrer">loaded bufferlist</a>, hoping that I can have both a forward and reversed version of each loaded buffer, like so: </p>
  
  <pre><code>    function finishedLoading(bufferList)  {
          for (var it = 0; it &lt; this.urlList.length; ++it) {  
              storedBuffer[it] = bufferList[it]; // assign bufferList to globals
              storedBufferR[it] = bufferList[it];
  
              // attempt to reverse storedBufferR only ...
              Array.prototype.reverse.call( storedBufferR[it].getChannelData(0) );
              Array.prototype.reverse.call( storedBufferR[it].getChannelData(1) ); 
          }
      }
  </code></pre>
  
  <p>The above function indeed reverses playback, however it reverses both 'storedbufferR' <em>and</em> 'storedbuffer' such that all buffers are reversed!</p>
  
  <p>So here is where I get lost... I understand that Array.protoype affects all arrays, so I suppose I can see how 'storedBuffer' is affected by a reverse method on 'storedBufferR'. EDIT: the reverse method only affects the array in question</p>
  
  <p>But is it possible to rewrite the above function to ensure array.protoype affects only the stored buffer I want reversed? If not, is there another way to go about storing both a forward and reversed version? </p>