Skip to content

Generates a header to write to a .wav-file. After that, you can write a raw buffer.

License

Notifications You must be signed in to change notification settings

karlwestin/node-waveheader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WaveHeader

Just generates a WAVE-file header, with the specified length as argument.

var header = require("waveheader");
//write to a normal fs.createWriteStream
myFileStream.write(header(44100 * 8)); // 44100 khz * 8 seconds


// using options (all available options listed)
myOtherFileStream.write(header(22050 * 8) {
  sampleRate: 22050,
  channels: 2,
  bitDepth: 8
}); 

Use with tonegenerator:

Also check out the module for generating tones as raw PCM data, tonegenerator.

using the debug module

Waveheader uses the 'debug' module to clean the output a bit. If running your program from the command line, and you wanna see the size written to the header, do DEBUG=waveheader node yourprogram.js

About

Generates a header to write to a .wav-file. After that, you can write a raw buffer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published