title: Streaming .wav audio fails, but plays when downloaded separately
body: <p>I am having trouble over streaming of wav audio files with androids MediaPlayer.</p>
  
  <p>The URL for wave files are verified and downloaded separately on device successfully.
  Those downloaded files plays with no issue, but when same file is streamed to the player, it won't play at all and gives error.</p>
  
  <pre><code>01-18 09:25:00.963: E/MediaPlayer(8825): error (1, -4)
  01-18 09:25:00.963: W/System.err(8825): java.io.IOException: Prepare failed.: status=0x1
  01-18 09:25:00.963: W/System.err(8825):     at android.media.MediaPlayer.prepare(Native Method)
  01-18 09:25:00.963: W/System.err(8825):     at com.movivation.wavetrial.AudioPlayer.playMedia(AudioPlayer.java:174)
  01-18 09:25:00.963: W/System.err(8825):     at com.movivation.wavetrial.AudioPlayer.onCreate(AudioPlayer.java:92)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2633)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2685)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.ActivityThread.access$2300(ActivityThread.java:126)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
  01-18 09:25:00.963: W/System.err(8825):     at android.os.Handler.dispatchMessage(Handler.java:99)
  01-18 09:25:00.963: W/System.err(8825):     at android.os.Looper.loop(Looper.java:123)
  01-18 09:25:00.963: W/System.err(8825):     at android.app.ActivityThread.main(ActivityThread.java:4633)
  01-18 09:25:00.963: W/System.err(8825):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-18 09:25:00.973: W/System.err(8825):     at java.lang.reflect.Method.invoke(Method.java:521)
  01-18 09:25:00.973: W/System.err(8825):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  01-18 09:25:00.973: W/System.err(8825):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  01-18 09:25:00.973: W/System.err(8825):     at dalvik.system.NativeStart.main(Native Method)
  01-18 09:25:00.973: I/MediaPlayer(8825): Info (1,26)
  </code></pre>
  
  <p>My code to play the file:</p>
  
  <pre><code>private void playMedia(boolean isWebUrl) {
      mPlayer = new MediaPlayer();
      mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  
      mPlayer.setOnCompletionListener(new OnCompletionListener() {
  
          @Override
          public void onCompletion(MediaPlayer mp) {
              Log.d(tag, "Ending thread");
              isPlaying = false;
              if (pd != null) {
                  pd.dismiss();
              }
          }
      });
  
      mPlayer.setOnPreparedListener(new OnPreparedListener() {
  
          @Override
          public void onPrepared(MediaPlayer mp) {
              Log.d(tag, "starting");
  
              mPlayer.start();
              mSeekbar.setProgress(0);
              mSeekbar.setMax(mPlayer.getDuration());
  
              Log.d(tag, "seek started");
              new PlayAsync().execute();
          }
      });
  
      mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
  
          @Override
          public void onStopTrackingTouch(SeekBar seekBar) {
          }
          @Override
          public void onStartTrackingTouch(SeekBar seekBar) {
          }
          @Override
          public void onProgressChanged(SeekBar seekBar, int progress,
                  boolean fromUser) {
              if (fromUser) {
                  mPlayer.seekTo(progress);
                  mSeekbar.setProgress(progress);
              }
          }
      });
  
      try {
          if (isWebUrl) {
              Log.d(tag, "playing tmp file");
              mPlayer.setDataSource(url);
          } else {
              File f = new File(fileurl);
              FileInputStream fis = new FileInputStream(f);
              mPlayer.setDataSource(fis.getFD());
          }
  
          Log.d(tag, "calling prepare");
          mPlayer.prepare(); //originally i use prepareAsync()
      } catch (IllegalArgumentException e) {
          e.printStackTrace();
      } catch (IllegalStateException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>The file I am trying to play is actually a wave file, and I have not found any concrete statement about the error mentioned above.</p>
  
  <p>Any pointer regarding streaming of wave or the error itself would be highly appreciated.
  Thanks.</p>