I need to calculate the total length of an mp3 file.
I am currently using the PHP class that I found @ http://www.zedwood.com/article/php-calculate-duration-of-mp3 .
This works great if the mp3 file is on the same server.
but if I have a URL from another site, it throws an error. Please help me.
Is there a J-Query JavaScript function to get the length of an mp3 file.
<?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->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); ?>
Ricky source share