If you are still looking for the answer, install MP3::Info and use:
$mp3->time_mm_ss();
Other things you can use:
total_secs()
total_secs_int()
total_mins()
leftover_secs()
leftover_msec()
See the bottom of the MP3::Tag page for details
What is the difference between "let" and "var"?
How do I replace all occurrences of a string?
How to randomize (shuffle) a JavaScript array?
How do I format a date in JavaScript?
How can I get query string values in JavaScript?
How to access the correct `this` inside a callback
How do I check if a directory exists? "is_dir", "file_exists" or both?
How to create an array from a CSV file using PHP