songduration

1.0.2 • Public • Published

Song duration extractor

A song duration data extractor

Installation

  1. Install sox dependency

  2. Install the package npm install --save songduration

NOTE: This will only work for remotedly hosted files

Dependencies

  • node 8.0.0
  • From Linux repos sox

Setup

  1. Give execution permissions to setup file

chmod +x ./bin/setup.sh

  1. Install nvm

npm install nvm

  1. If you are using ubuntu, add the repo to the sources list file

File: /etc/apt/sources.list Line to add (in case of xenial): http://cz.archive.ubuntu.com/ubuntu xenial

sudo apt-get update

If you have another version of ubuntu, just change the xenial part of the command and put the version name in there

  1. Run setup script

./bin/setup.sh

Usage

Create a new instance of the SongDurationExtractor

songDuraionData = new SongDurationExtractor({
    url: 'url', /* required, string, */
    limit: 1024 * 16 /* optional, integer, this is the default value (1024 * 16) */
})

songDurationData.getDuration()
    .then(songData => {
        //Do whatever you need to do with songData
    })
    .catch(error => console.error.bind(console));

TODO:

  • [ ] Add support for locally hosted files

Readme

Keywords

Package Sidebar

Install

npm i songduration

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

5.59 kB

Total Files

8

Last publish

Collaborators

  • vctr90