How I can get the length of an audio file in php.
If it\'s too hard to do in php then any other way should work alright.
If you're using linux / unix and have ffmpeg installed, just do this:
$time = exec("ffmpeg -i " . escapeshellarg($path) . " 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//");
list($hms, $milli) = explode('.', $time);
list($hours, $minutes, $seconds) = explode(':', $hms);
$total_seconds = ($hours * 3600) + ($minutes * 60) + $seconds;