yss14 / mp3-duration

Get the duration of an MP3 file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mp3-duration Travis-Build

Calculate duration of an MP3

Install

$ npm install --save mp3-duration

Usage

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');
});

API

mp3Duration(filePath, callback)

filePath

Type: string

Path to the file

callback(error, duration)

Type: function

Callback to be called once duration is calculated

License

MIT © Han de Boer

About

Get the duration of an MP3 file

License:MIT License


Languages

Language:JavaScript 100.0%