node-wav
This module offers a fast and basic (moving average-based) low pass filter to be used with node-wav.
Installation
Install through npm:
$ npm install lowpass
Example
Here's how you would use the lowpass filter on a standard PCM WAVE file out of the speakers using
node-wav
and node-speaker
:
var fs = ;var wav = ;var Speaker = ;var LowPass = ;var file = fs;var reader = ;var speaker lowpass;// the "format" event gets emitted at the end of the WAVE headerreader;// pipe the WAVE file to the Reader instancefile;
LowPass())
The LowPass
class accepts the data from node-wav outputs the raw
audio data transformed by the low pass.
it has the following options :
//First formformat : format //format from node-wav, mandatory optionmovAvLength : 128 // moving average window;//Second Formformat : format //format from node-wav, mandatory optionmovAvLength : 152 // Hz;
By default the cut-off correspond to a 128 length moving average window. For a 44100 sampleRate, it is equivalent to 152Hz low pass filter.