title: How to send AJAX POST request and play the audio in the response?
body: <p>I am building an app where the user can click a button, and it sends data to the server. The server then computes audio based on the data in the request (most likely a POST), and returns a WAV file to the browser.</p>
  
  <p>I have already built the part with accepting a post request and responding with the wav file, but I can't figure out how to send the request in JS and to play the response to the user.</p>
  
  <p>Also, the playing of the audio must start (almost) as the first byte comes in, as the audio files are quite large, and the user can't just wait for the request to be completed.</p>
  
  <p>I am also open to suggestions changing how the server sends the file: the server is made in <a href="http://flask.pocoo.org/" rel="nofollow noreferrer">flask</a></p>