title: Custom MediaStream
body: <p>I'm receive raw float32 audio through websockets and would like to playback this in the browser. From my understanding I would need to to use MediaStream API for this. However, I cannot find a way to create a MediaStream which I can append data buffers to.</p>
  
  <p>What is the proper way to achieve this?</p>
  
  <p>I'm trying something like this:</p>
  
  <pre><code>    var context = new AudioContext();
  
      context.sampleRate = 48000;
  
      var stream = null; // ????
  
      var source = context.createMediaStreamSource(stream);
      source.connect(context.destination);
      source.start(0);
  
      socket.onmessage = function (event) {
          stream.appendBuffer(new Float32Array(event.data)); // ????
      };
  </code></pre>