Calculate duration of an MP3
$ npm install --save mp3-duration
var mp3Duration = require('mp3-duration');
mp3Duration('file.mp3', function (err, duration) {
if (err) return console.log(err.message);
console.log('Your file is ' + duration + ' seconds long');
});
Type: string
Path to the file
Type: function
Callback to be called once duration is calculated
MIT © Han de Boer