title: Web audio API does not play sound Continuously
body: <p>I am trying to buffer MP3 songs using node js and socket io in real time. I basically divide the MP3 into segments of bytes and send it over to the client side where the web audio API will receive it, decode it and start to play it. The issue here is that the sound does not play continuously, there is a something like a 0.5 seconds gap between every buffered segment. How can I solve this problem</p>
  
  <pre><code>// buffer is a 2 seconds decoded audio ready to be played 
  // the function is called  when a new buffer is recieved
  function stream(buffer)
  {
      // creates a new buffer source and connects it to the Audio context
      var source = context.createBufferSource();
      source.buffer = buffer;
      source.connect(context.destination);
      source.loop = false;
      // sets it and updates the time 
      source.start(time + context.currentTime);
  
      time += buffer.duration; // time is global variable initially set to zero
  }
  </code></pre>
  
  <p>The part where stream is called </p>
  
  <pre><code>    // where stream bufferQ is an array of decoded MP3 data 
      // so the stream function is called after every 3 segments that are recieved 
       // the Web audio Api plays it with gaps between the sound
      if(bufferQ.length == 3)
      {
          for(var i = 0, n = bufferQ.length ; i &lt; n; i++)
          {
                stream(bufferQ.splice(0,1)[0]);
          }
      }
  </code></pre>
  
  <p>should I use a different API other than the web audio API or is there a way to schedule my buffer so that it would be played continuously ?</p>