JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53197
  • Score
    100M100P100Q136133F

`Reader` and `Writer` streams for Microsoft WAVE audio files

Package Exports

  • wav
  • wav/lib/file-writer
  • wav/lib/writer

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 (wav) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-wav

Reader and Writer streams for Microsoft WAVE audio files

This module offers streams to help work with Microsoft WAVE files.

Installation

Install through npm:

$ npm install wav

Example

Here's how you would play a standard PCM WAVE file out of the speakers using node-wav and node-speaker:

var fs = require('fs');
var wav = require('wav');
var Speaker = require('speaker');

var file = fs.createReadStream('track01.wav');
var reader = new wav.Reader();

// the "format" event gets emitted at the end of the WAVE header
reader.on('format', function (format) {

  // the WAVE header is stripped from the output of the reader
  reader.pipe(new Speaker(format));
});

// pipe the WAVE file to the Reader instance
file.pipe(reader);

API

Reader class

Writer class

FileWriter class