title: Android playing external MP3: error -- MediaPlayer start called in state 1
body: <p>I'm having trouble playing an external MP3 file on Android. I'm using the following code:</p>
  
  <pre><code>MediaPlayer player = new MediaPlayer();
  try {
      BufferedInputStream bis = new BufferedInputStream(new java.net.URL(url).openStream());
      FileOutputStream fos = new FileOutputStream(Environment.getExternalStorageDirectory().getPath() + "/forvo_temp.mp3");
      BufferedOutputStream bos = new BufferedOutputStream(fos,1024);
      byte [] data = new byte[1024];
  
      int x=0;
      while((x=bis.read(data,0,1024))&gt;=0){
          bos.write(data,0,x);               
      }
      player.reset();
      player.start();
  
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p><code>url</code> is the string where the external file is. I do have write permission for the SD card (<code>WRITE_EXTERNAL_STORAGE</code>).</p>
  
  <p>On the debug, I see:</p>
  
  <pre><code>E MediaPlayer start called in state 1
  E MediaPlayer error (-38, 0)
  E MediaPlayer Error (-38,0)
  </code></pre>
  
  <p>What might the problem be?</p>