3.0.1 • Published 8 years ago

waveform v3.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

node-waveform

npm.io

Input: any format audio or video file

Output: any or all of these:

  • transcoded audio file
  • waveform.js-compatible JSON representation of the audio file
  • PNG rendering of the waveform

This is a Node.js module that wraps the waveform command line interface. The C code is bundled from that repository, so if you want to file an issue with or fork the C code, go to the waveform repository.

Usage

At least one of the options transcode, waveformjs or png is required as output destination.

var waveform = require('waveform');

waveform(audiofile, {
  // options
  'scan': false,                  // whether to do a pass to detect duration

  // transcoding options
  transcode: "outputfile.mp3",    // path to output-file, or - for stdout as a Buffer
  bitrate: 320,                   // audio bitrate in kbps
  format: "name",                 // e.g. mp3, ogg, mp4
  codec: "name",                  // e.g. mp3, vorbis, flac, aac
  mime: "mimetype",               // e.g. audio/vorbis
  'tag-artist': "artistname",     // artist tag
  'tag-title': "title",           // title tag
  'tag-year': 2000,               // year tag
  'tag-comment': "comment",       // comment tag

  // waveform.js options
  waveformjs: "outputfile.json",  // path to output-file, or - for stdout as a Buffer
  'wjs-width': 800,               // width in samples
  'wjs-precision': 4,             // how many digits of precision
  'wjs-plain': false,             // exclude metadata in output JSON (default off)

  // png options
  png: "outputfile.png",          // path to output-file, or - for stdout as a Buffer
  'png-width': 256,               // width of the image
  'png-height': 64,               // height of the image
  'png-color-bg': '00000000',     // bg color, rrggbbaa
  'png-color-center': '000000ff', // gradient center color, rrggbbaa
  'png-color-outer': '000000ff',  // gradient outer color, rrggbbaa
}, function(err, buf) {
  // done
});

Installation

  1. Install libgroove dev package. Only the main library is needed. Packages are available for common package managers.

  2. Install libpng and zlib dev packages.

  3. npm install waveform

3.0.1

8 years ago

3.0.0

9 years ago

2.0.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.6.0

11 years ago

0.5.2

11 years ago

0.5.1

12 years ago

0.5.0

12 years ago

0.4.2

12 years ago

0.4.1

12 years ago

0.4.0

12 years ago

0.3.0

12 years ago

0.2.0

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago