An open API service indexing awesome lists of open source software.

https://github.com/apsdehal/mp3-length

NPM module for calculating length of a mp3 file
https://github.com/apsdehal/mp3-length

Last synced: 4 months ago
JSON representation

NPM module for calculating length of a mp3 file

Awesome Lists containing this project

README

          

# mp3-length ![Travis-Build](https://travis-ci.org/apsdehal/mp3-length.svg?branch=master)

> Calculate length of a mp3

Provides an api to calculate length of mp3 files

## Requirements

- mp3info - Use `apt-get install mp3info` to get

## Install

```
$ npm install --save mp3-length
```

## Usage

```javascript
var mp3Length = require('mp3-length');

mp3Length('file.mp3', function (err, length) {
if (err == null) {
console.log(length);
}
});

```

## API

## mp3Length(filepath, callback)

### filepath

Type: `string`

Path to the file

### callback(error, length)

Type: `function`

Callback to be called once length is calculated

## License

MIT © [Amanpreet Singh](http://apsdehal.in)