title: put live audio input data into array
body: <p>Hey I am using GetUserMedia() to capture audio input from user's microphone. Meanwhile I want to put  captured values into an array so I can manipulate with them. I am using the following code but the problem is that my array gets filled with value 128 all the time (I print the results in console for now), and I can't find my mistake. Can someone help me find my mistake?</p>
  
  <pre><code>//create a new context for audio input
  context = new webkitAudioContext();
  var analyser = null;
  var dataarray = [];
  
  getLiveInput = function() {
   navigator.webkitGetUserMedia({audio: true},onStream,onStreamError);
  };
  
  function onStream(stream) 
  {
    var input = context.createMediaStreamSource(stream);
    analyser = context.createAnalyser();
    var str = new Uint8Array(analyser.frequencyBinCount);
    analyser.getByteTimeDomainData(str);
    for (var i = 0; i &lt; str.length; i++) {
      var value = str[i];
  
      dataarray.push(value);
      console.log(dataarray)
    }//end for loop
  }//end function
  
  function onStreamError(e) {
    console.error('Streaming failed: ', e);
  };
  </code></pre>