PHP: Detect Track Length
- Started
- Last post
- 4 Responses
- phirschybar
Just looked all over php.net and can't find anything. Any way to detect the track length of say, an mp3 in php. I am streaming into flash but I need to get the total file duration first so I can make a good scrubber tool.
- kinetic0
cant you just do it in flash?
var my_sound:Sound = new Sound();
my_sound.onLoad = function(success:Boolean) {
var totalSeconds:Number = this.duration/1000;
trace(this.duration+" ms ("+Math.round(totalSeconds)+" seconds)");
var minutes:Number = Math.floor(totalSeconds/60);
var seconds = Math.floor(totalSeconds)%60;
if (seconds
- sparker0
yes.
- cosmo0
http://getid3.sourceforge.net/
check this out.
- phirschybar0
kinetic.. my problem is that duration in flash goes from 0 to whatever as the file streams in, it doesn;t start me out with the correct, full duration. know what I mean?