Git Product home page Git Product logo

node-waveform's Introduction

node-waveform

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

node-waveform's People

Contributors

andrewrk avatar ad-si avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.