title: Using <audio> element for playback of raw audio
body: <p>I'm working on a little project that decrypts (using openpgp.js) and decodes a server-side audio file using the Web Audio API. The decrypted file arrives to the client as raw audio. Currently I can play back audio files using <code>source.start(0)</code> but there doesn't seems to be an easy way to dump the audio to a GUI that would allow users to do things like adjust volume and seek through the audio.</p>
  
  <p>I have a <code>AudioContext</code> object that's decoded and buffered with <code>createBufferSource</code></p>
  
  <pre><code>function playSound(decodedAudio) {
    var source = context.createBufferSource();
    source.buffer = decodedAudio;
    source.connect(context.destination);
    source.start(0);
  }
  </code></pre>
  
  <p>Because it's raw audio being received I can't simple use something like <code>audio.src = ...</code> with an audio element. Or maybe I'm overlooking something obvious?<br>
  Is there a way to have this decoded audio within the Web Audio API play nicely with a destination <code>&lt;audio&gt;</code> element?</p>
  
  <p><strong>The ideal flow would look something like...</strong><br>
  1) User clicks to engage the playback of an audio clip<br>
  2) The audio is decrypted server side and sent to the client as a raw audio<br>
  3) The audio is decoded and playable, seekable...etc.</p>
  
  <p><strong>Possible solutions that I'd love thoughts on</strong><br>
  - Because the audio files can range anywhere from 1 minute to 60 minutes, write the audio to a file using the FileSystem API and then use an <code>&lt;audio&gt;</code> element for actual playback<br>
  - Write my own control system for pausing, scrubbing, and volume on top of the Web Audio API</p>