wav

waver

Fast wave-pcm reader for Node.js applications.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

9yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

3.7KB

License

BSD-2-Clause

Type Definitions

Tree-Shakeable

No?

Categories

Readme

# Installing waver To install your super-duper wave reader into your node.js aplication just run the following:

    npm install waver
    

Simple usage

You will need an audio buffer (only WAVE PCM without compression is supported at this time). The following sample code should get you started:

var waver = require('waver');

var audioBuffer = require('fs').readFileSync('pathToYourFile');

waver.readRaw(audioBuffer, function(e,wave){ 
  
  if (e) console.log('Error: ', e);
  
  console.log(wave);

});

This will output the following JSON structure:

{ RIFFChunk: { ChunkID: 'RIFF', Format: 'WAVE', ChunkSize: 17147876 },
  FormatChunk: 
   { Subchunk1ID: 'fmt ',
     Subchunk1Size: 16,
     AudioFormat: 1,
     NumChannels: 1,
     SampleRate: 8000,
     ByteRate: 16000,
     BlockAlign: 2,
     BitsPerSample: 16 },
  DataChunk: 
   { Subchunk2ID: 'data',
     Subchunk2Size: 17147840,
     Data: <Buffer 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 0 ...> } }
     

Instead of readRaw you can use the read method to return an aditional element with the audio data in a numeric form.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial