1.0.2 • Published 6 years ago
songduration v1.0.2
Song duration extractor
A song duration data extractor
Installation
Install
sox
dependencyInstall 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
- Give execution permissions to setup file
chmod +x ./bin/setup.sh
- Install nvm
npm install nvm
- 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
- 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