How do you get how do u get size of mp3 file in bytes to calculate length of mp3?
Example T= Size of Mp3 file in bytes x 8 / Bitrate
$filesize = filesize($filename);
$stage2= $filesize*8;
not sure how to retreave the bitrate from an mp3
i know bitrate. how to get the filename? what function to use? can u show me example?
i think
$handle = fopen($dir . $file, "rb"); // Read as binary $size = filesize($dir . $file);
$filename = "1.mp3";
$stage2 = $filesize*8;
$bitrate = 128;
$afterbit = $stage2/$bitrate;
Something Like that.
thanks I managed to get length of mp3
how to convert 11sec to 00:11
can you not use date?
date("i:s" ,$time)
thank you for your help. problem solved.
Hi, I'm working on a podcast rss feed.
I need to get the length and the size of a video(mp4) file. could I use the same process?
and is this code open sources somewhere?