title: How to get the size and duration of an mp3 file?
body: <p>I need to calculate the total length of an mp3 file.</p>
  
  <p>Currently I am using a PHP class which I found @ <a href="http://www.zedwood.com/article/php-calculate-duration-of-mp3" rel="noreferrer">http://www.zedwood.com/article/php-calculate-duration-of-mp3</a>.</p>
  
  <p>This is working perfectly if the mp3 file in same server.</p>
  
  <p>but if I have a URL from other site it throwing error. Please help me.</p>
  
  <p>Is there any JavaScript J-Query function to get the length of the mp3 file</p>
  
  <pre><code>&lt;?php include("mp3.class.php");
  $f = 'http://cdn.enjoypur.vc/upload_file/5570/5738/5739/7924/Blue%20Eyes%20-%20Yo%20Yo%20Honey%20Singh%20(PagalWorld.com)%20-192Kbps%20.mp3';
  $m = new mp3file($f);
  $a = $m-&gt;get_metadata();
  
  if ($a['Encoding']=='Unknown')
      echo "?";
  else if ($a['Encoding']=='VBR')
      print_r($a);
  else if ($a['Encoding']=='CBR')
      print_r($a);
  unset($a);
  ?&gt;
  </code></pre>