Calculate duration of an MP3
$ npm install --save mp3-duration
var mp3Duration = ;;
mp3Duration(filePathOrBuffer [, cbrEstimate] [, callback])
Path to the file or a buffer with the file's contents
false. When set to
true, will estimate the length of a
constant-bitrate mp3. This speeds up the calculation a lot but isn't
guaranteed to be accurate.
Callback to be called once duration is calculated. It's also possible to
instead use the returned
duration is the duration of the
mp3Duration returns a Promise that resolves to the duration of the mp3 in
ms or rejects with some error.
MIT © Han de Boer