JSPM

node-shntool

0.2.0-alpha
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q36179F
  • License MIT

Node interface to shntool (http://www.etree.org/shnutils/shntool/)

Package Exports

  • node-shntool

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-shntool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-shntool

Node interface to shntool application (http://www.etree.org/shnutils/shntool/)

Synopsis

The 'shntool' application is a multi-purpose WAV file data processing tool. It can process any file that contains WAVE type data, compressed or not, provided there is a format module to handle that particular file time.

This node module acts as a Node.js interface to that application.

Getting Started

You will need have installed the shntool software to use this module. It can be obtained here: http://www.etree.org/shnutils/shntool

Installation

Just install the node module into your project from NPM

npm install --save node-shntool

Code Examples

This is the first release of this interface, it is currently experimental. It currently supports 'CUE file' generation and joining files. The first argument to the promise calls is a string or list of strings used by the 'globby' module to locate the input files. The second argument to the promise calls is any options for the function itself.

Include the module

var shntool = require('shntool');

CUE File Generation

The cuefile function is a promise. The generated cue file result is an array of text lines.

shntool.cuefile('prefix-*.wav').then(
  function(cuelines) {
      // each line of the CUE lines is available here
      console.log(cuelines.join('\n'));
  }
).catch( (err) => { 
  // handle error
});

Create a Joined file

The joined function is a promise. The file path of the created file is the result.

// note that the options here are actually the defaults so you can omit them
shntool.joined('prefix-*.wav', { destfile: 'joined.wav', dir: '.' }).then(
  function(joinedfile) {
    // the joinedfile is actually on the file system at this point
    // if you combine the CUE file with the joined file you can burn a CD
  }
).catch( (err) => { 
  // handle error
});

Convert FLAC Files

The convert function is a promise. The result is an array of the target file paths as parsed from the conversion. Currently only converting FLAC files to WAV files is supported (tested).

// note that the options here are actually the defaults so you can omit them
shntool.convert('prefix-*.wav', { dir: '.' }).then(
  function(convertedFiles) {
    // convertedFiles is an array of file paths (the target files)
  }
).catch( (err) => { 
  // handle error
});

License

This module itself is MIT licensed. Feel free. The 'shntool' and its helper applications have their own licenses.