title: MediaPlayer shows wrong durations for some MP3 files
body: <p>I'm developing an app that plays every verse of the Quran. There are 6348 audio files, and they're all hosted by someone else and their URL is of a specific format (e.g. <a href="http://www.url.com/%7B001-001%7D" rel="nofollow noreferrer">www.url.com/{001-001}</a>).</p>
  <p>Now for a lot of the verses, when I try to get the mp3 file's duration, it returns the wrong duration. An example being this file: <a href="https://www.dropbox.com/s/lssoh5abug9xezz/002-003-AR.mp3?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/lssoh5abug9xezz/002-003-AR.mp3?dl=0</a>. It keeps giving me the duration as 6189 when the file is around 9 seconds long.</p>
  <p>This issue applies to some files while others seem fine. How can I fix this issue? Downloading all 6348 files and making changes to them isn't an option due to the sheer number.</p>
  <p>I have tried using both <code>mediaPlayer.getDuration()</code> as well as the following method, but with the same results:</p>
  <pre><code>MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
  metaRetriever.setDataSource(&quot;https://www.alislam.org/quran/search2/mp3-3/002-003-AR.mp3&quot;, new HashMap&lt;String, String&gt;());
  try {
      URL url1=new URL(&quot;https://www.alislam.org/quran/search2/mp3-3/002-003-AR.mp3&quot;);
      AudioFileFormat fileFormat = AudioSystem.getAudioFileFormat(url1.);
  } catch (MalformedURLException e) {
      e.printStackTrace();
  }
  for (int i=0; i &lt; 40; i++){
      String m = metaRetriever.extractMetadata(i);
      System.out.println(&quot;********************** &quot; + m);
  }
  </code></pre>
  <ol>
  <li>I'm assuming it's an issue with the MP3 files themselves. Is that
  the case?</li>
  <li>What would be the best way to get around this without having to modify each file and re-upload them? Clearly if I'm able to play it in the browser and it shows the correct 9 seconds, I should be able to get that 9 second value using some way if not the above mentioned ways?</li>
  <li>I need this duration primarily to set <code>seekBar.setMax(duration);</code> Is there another way of achieving this?</li>
  </ol>