Thursday, 13 April 2017

How do I apply a Biquad filter on PCM data from stdin in Node.js?

I want to pipe PCM data (in standard cd format: 16-bit stereo, 44.1Khz) to a Node.js program to apply a Biquad filter to it and output it to the speaker afterwards. How do I do this? I tried the following:

var BiquadFilter = require('audio-biquad');
var Speaker = require('audio-speaker');
var Generator = require('audio-generator');

var Piped_In_PCM_audio_Data;
process.stdin.pipe(Piped_In_PCM_audio_Data)

Generator(function () {
    return Piped_In_PCM_audio_Data;
}, {
    duration: 9999999
})
.pipe(BiquadFilter({
    type: 'highpass',
    frequency: 440,
    Q: 100,
    gain: 25
}))
.pipe(Speaker());



via Okala

No comments:

Post a Comment