title: Blob containing a WAV file and a WAV file: what's the difference and how to convert to each other?
body: <p>Premise: I noticed there a other similar questions but looks like the interesting ones have no answers. e.g. <a href="https://stackoverflow.com/questions/25457680/have-a-blob-for-a-wav-file-on-client-side-how-do-i-send-it-as-a-wav-file-to-the">Have a blob for a wav file on client side, how do I send it as a wav file to the server?</a></p>
  
  <p>I'm using <strong>RecordRTC</strong> to get a WAV file on user voice input.</p>
  
  <p>What I get is a Blob (binary file) printed (on console) as:</p>
  
  <pre><code>Blob {}
    size: 131116
    type: "audio/wav"
    __proto__
  </code></pre>
  
  <p>I understand that the Blob contains a WAV audio stream but the WAV is contained by a Blob, rather than a WAV container (i.e. a WAV file). <strong>right?</strong></p>
  
  <p>So, <strong>how do I extract the WAV stream</strong>, e.g. to send it to a server through an ajax/http call?</p>
  
  <p>I don't mind using a HTTP or NodeJS script if it's needed.</p>
  
  <p><strong>EDIT</strong> I will try what's been proposed in one answer.
  Since I'm doing this in AngularJS (I'm still a beginner at it) I'd like to do something like...</p>
  
  <pre><code>services.sendAudioMessage(recordedAudio)
      .then(function (data) {
  }
  </code></pre>
  
  <p>where <strong>services</strong> is defined by a factory:</p>
  
  <pre><code>.factory('services', function($http,$q) {
      return {
          sendAudioMessage: function (audioMessage) {
              return $http.jsonp('http://.../api.php?callback=JSON_CALLBACK', {
                  params: {
                      audio: audioMessage
                  }
              })
                  .then(function (response) { 
                      if (typeof response.data === 'object') {
                          return response.data;
                      } else { 
                          return $q.reject(response.data);
                      }
                  }, function (response) { 
                      return $q.reject(response.data);
                  });
          }
      };
  });     
  </code></pre>
  
  <p>rather than using an Ajax call as proposed in: <a href="https://stackoverflow.com/questions/13333378/how-can-javascript-upload-a-blob/13333478#13333478">How can javascript upload a blob?</a></p>