1.0.0 • Published 9 years ago
audio-processor v1.0.0
Process audio stream by a custom function. Very similar to audio-generator, but operates on input data. Mostly just a toy for testing concepts.
Usage
var Generator = require('audio-generator');
var Processor = require('audio-processor');
var Speaker = require('audio-speaker');
Generator(function (t) {
var frequency = 440;
return [Math.sin(2 * Math.PI * t * frequency), Math.sin(2 * Math.PI * t * frequency)];
})
.pipe(Processor({
process: function (data, time, n) {
return [Math.sin(Math.PI * 2 * time * 439), Math.sin(Math.PI * 2 * time * 441)];
},
//or redefine this, to process times faster
//processFrame: function (channelsData, n) { return channelsData; }
}))
.pipe(Speaker());
Related
audio-generator — generate audio stream with a function.
1.0.0
9 years ago