title: Playing raw audio PCM samples in Web Audio
body: <p>I have an array of sound samples (16-bit):</p>
  
  <pre><code>[0, 120, 320, 120, 0, -100, -30000, 65, 2, 3, 10, ...]
  </code></pre>
  
  <p>They range -32768 to 32767. I would like to be able to play the samples using the Web Audio API.</p>
  
  <p>I know that it expects the source buffer to be an <code>ArrayBuffer</code>, but I can't quite figure out how to convert a bunch of samples to an <code>ArrayBuffer</code> to be played with the Web Audio API.</p>
  
  <p>Any tips?</p>