title: Loading .wav into a Audio Buffer
body: <p>I'm trying to create a little web-app in javascript which plays some random chords by playing multiple audio files for each note at the same time.</p>
  <p>I found out that this does not work if I use the normal &quot;Audio&quot; class because they don't play simultaneously. (Not reliable) Therefore I want to use the Web Audio API. But here I run into a problem:
  How do I convert my &quot;Audio()&quot;-object (or any &quot;.wav&quot; file) into a AudioBuffer?</p>
  <pre><code>const AudioContext = window.AudioContext || window.webkitAudioContext;
  var audioCtx = new AudioContext();
  var audioElement = new Audio(&quot;sounds/cut/24.wav&quot;);
  
  myArrayBuffer = someUnknownFunction(audioElement);
  //Alternative: myArrayBuffer = someOtherUnknownFunction(&quot;sounds/cut/24.wav&quot;)
  
  var track = audioCtx.createBufferSource();
  track.buffer = myArrayBuffer;
  track.connect(audioCtx.destination);
  track.start(0);
  </code></pre>
  <p>Does anyone know, what this &quot;someUnknownFuntion(Audio)&quot; could be?</p>