TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   [PHP] Get mp3 song length (http://www.talkphp.com/general/2600-php-get-mp3-song-length.html)

tader 04-07-2008 06:12 PM

[PHP] Get mp3 song length
 
Hi,
Can anyone tell me how to get mp3 length using php
I try to use getId3() but i didn't understand it so can anyone give my a link or write in were a tutorial for get mp3 length plz ;]

delayedinsanity 04-07-2008 06:47 PM

I think you're looking for filesize(), unless you mean the play time of it? Which you probably do... so, I'd use getID3() in this case, and all you should need to do is;

PHP Code:

require_once('/path/to/getid3.php');

$getID3 = new getID3;
$filename "/path/to/mp3";

$ThisFileInfo $getID3->analyze($filename);
getid3_lib::CopyTagsToComments($ThisFileInfo);

echo @
$ThisFileInfo['playtime_string']; 

Just from taking a quick look at getID3(). I've never used it before, but it does have a directory full of demonstration pages to show you how to access various functions.
-m


All times are GMT. The time now is 07:28 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0