amr-duration

0.2.0 • Public • Published

amr-duration


Calculate amr duration,require node >= 6.0

Install

npm install amr-duration --save

Usage

  const amrDuration = require('amr-duration');
  
  // callback
  amrDuration('voice.amr', (err, duration) => {
    if (err) {
      console.log(err.message);
      return;
    }
    
    console.log(`You file is ${duration} millisecond long`);
  });
  
  // Promise
  armDuration('voice.amr')
    .then((duration) => {
      console.log(`You file is ${duration} millisecond long`);
    })
    .catch((err) => {
      console.log(err.message);
    });

API

armDuration(amr, callback)

amr

Type: String|Buffer|Stream

Path of the file or amr content

callback(err, duration)

Type: function

Callback to be called once duration(ms) is calculated

return

Type: Promise

Always return a Promise when call armDuration

Readme

Keywords

Package Sidebar

Install

npm i amr-duration

Weekly Downloads

27

Version

0.2.0

License

MIT

Unpacked Size

22.3 kB

Total Files

7

Last publish

Collaborators

  • pansinm