Skip to content

yanivkalfa/wav-headers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
});

About

create wav headers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published