Re[2]: [PHP] Find out how long an MP3 is
| From: | Kjetil Limkjaer | Date: | Wed, 22 Nov 2000 10:56:36 +0000 |
| Subject: | Re[2]: [PHP] Find out how long an MP3 is | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26609@lists.php.net to get a copy of this message | ||
Lawrence.Sheed@dfait-maeci.gc.ca wrote this on 22-11-2000:
LSdmgc> There is no length indicator in an mp3 file - would seem logical in its
LSdmgc> current usage, but mp3 was envisaged as a broadcast medium - ie no fixed
LSdmgc> endpoint.
<snip>
LSdmgc> There must be SOME way, because Napster, Gnutella and others list the
LSdmgc> length and bitrate of all the MP3 files you find in a search.
LSdmgc> I'm sure they're not playing every track on every hard drive in the world.
LSdmgc> It's out there somewhere...
I believe what Napster does, at least, is calculate the length from
the file size and the bitrate. Something like:
(filesize in bytes - header and tag size in bytes) / (bitrate / 8).
Should give you the length in seconds. At least I guess that's how it
does it, because it always screws up the length of variable bitrate
files. I guess you have to do some strange things to get the length of
those...
Kindest regards,
Kjetil
--
"You don't have a disease. You just live in New Jersey."
| OMNIS/PHP/SQL Developer for FIQAS Software, Aalsmeer, The Netherlands. |
} If I had an opinion in this message, it's probably my own. {