title: Progressive download of audio file
body: <p>I want to write an app that plays progressively-downloaded audio from a remote http source through the standard Android <code>mediaplayer</code>, but I want to save a copy of the audio file to the SD card as well.  This has proved to be a hard problem: </p>
  
  <p>1) We pass a <code>uri</code> to the media player and are then "cut out of the loop" during playback, because <code>mediaplayer</code> talks directly to the remote  thereby not having access to the bytes being played</p>
  
  <p>2) There doesn't seem to be an option for Android to write downloaded bits to disk, nor a callback to access downloaded data</p>
  
  <p>3) While it's possible embed a webserver into our app (see <code>nanohttpd</code>), and then pass a <code>localhost</code> uri into <code>mediaplayer</code>, this seems like a horrible kludge</p>
  
  <p>Am I missing a simpler way?  This must be a solved problem?!</p>
  
  <p><strong>Edit:</strong> Perhaps a simpler question: if I have a buffer in memory that contains music, can I play it?  It seems ridiculous that I have to write it to disk or use a web server to get the <code>mediaplayer</code> to play it.</p>