Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karlwestin/node-waveheader
Generates a header to write to a .wav-file. After that, you can write a raw buffer.
https://github.com/karlwestin/node-waveheader
Last synced: about 1 month ago
JSON representation
Generates a header to write to a .wav-file. After that, you can write a raw buffer.
- Host: GitHub
- URL: https://github.com/karlwestin/node-waveheader
- Owner: karlwestin
- License: apache-2.0
- Created: 2013-03-16T17:27:25.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T08:27:35.000Z (over 6 years ago)
- Last Synced: 2024-10-26T23:21:49.546Z (about 2 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 19
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
WaveHeader
====Just generates a WAVE-file header, with the specified length as argument.
```javascript
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](http://npmjs.com/package/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`