wav-headers

1.0.1 • Public • Published

wav-headers

Generates wav header buffer to concatenated with the wav body buffer

This is mostly a wrapper around: https://github.com/TooTallNate/node-wav just without streams and designed for full file cases.

Installation

Install through npm:

$ npm install wav-headers

Example

var fs = require('fs');
var getFileHeaders = require('wav-headers');
 
// those are defaults
var options = {
    channels: 2,
    sampleRate: 44100,
    bitDepth: 16,
    dataLength: 4294967295
};
 
var headersBuffer = getFileHeaders(options);
var fullBuffer = Buffer.concat([ headersBuffer, fileBodyBuffer ]);
 
var stream = fs.createWriteStream('./aFile.wav');
stream.write(fullBuffer, function() {
    stream.end();
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i wav-headers

Weekly Downloads

488

Version

1.0.1

License

MIT

Unpacked Size

4.39 kB

Total Files

5

Last publish

Collaborators

  • netameta