PHP Function to get MP3 duration
This should work for you, notice the getduration function: http://www.zedwood.com/article/127/php-calculate-duration-of-mp3
Get length of mp3 file
Try to use this getduration function: http://www.zedwood.com/article/127/php-calculate-duration-of-mp3
How to get duration of mp3 file in laravel 5.5
You can use package wapmorgan/mp3info
composer require wapmorgan/mp3info
Then you can use the library as follows.
$audio = new \wapmorgan\Mp3Info\Mp3Info($fileName, true);
$audio->duration \\ duration in seconds
Get the length of an audio file php
What kind of audio file? mp3? wav?
Anyway you will probably need some specific library.
See: http://de.php.net/manual/en/refs.utilspec.audio.php
Converting MP3 duration time
$minutes = bcmod(($duration / 60), 60);
is taking the minutes modulo 60. Unless your track is over an hour it will always say 0.
You want it to be
$minutes = floor($duration / 60);
Related Topics
Laravel Multiple Pagination in One Page
Example of How to Use Fastcgi_Finish_Request()
Php: Inserting Values from the Form into MySQL
Seamless Way to Check If User Likes Page
How to Find the Date of a Day of the Week from a Date Using PHP
Check If String Contains a Value in Array
What Does ${ } Mean in PHP Syntax
How to Call a PHP Script/Function on a HTML Button Click
Preg_Match(); - Unknown Modifier '+'
How to Efficiently Find the Closest Locations Nearby a Given Location
Laravel 5.2 - Use a String as a Custom Primary Key for Eloquent Table Becomes 0