FIX FORTHIS CODE :
Code: Select all
require_once('getid3/getid3.php');
require_once('getid3/getid3.lib.php');
$getID3 = new getID3;
$mixinfo = $getID3->analyze( $path );
// Optional: copies data from all subarrays of [tags] into [comments] so
// metadata is all available in one location for all tag formats
// metainformation is always available under [tags] even if this is not called
getid3_lib::CopyTagsToComments($mixinfo);
// Output desired information in whatever format you want
// Note: all entries in [comments] or [tags] are arrays of strings
// See structure.txt for information on what information is available where
// or check out the output of /demos/demo.browse.php for a particular file
// to see the full detail of what information is returned where in the array
//echo @$ThisFileInfo['comments_html']['artist'][0]; // artist from any/all available tag formats
//echo @$ThisFileInfo['tags']['id3v2']['title'][0]; // title from ID3v2
$bit_rate = $mixinfo['audio']['bitrate']; // audio bitrate
$play_time = $mixinfo['playtime_string']; // playtime in minutes:seconds, formatted string
//print_r($mixinfo);
if(substr_count($play_time,":")==2)
{
list($hours,$mins , $secs) = explode(':' , $play_time);
$play_time = (($hours*60)+($mins));
if($secs>30) $play_time++;
}
elseif(substr_count($play_time,":")==1)
{
list($mins , $secs) = explode(':' , $play_time);
$play_time = (($mins));
if($secs>30) $play_time++;
}
return $play_time;