I’d like to process audio with ScriptProcessorNode Interface but I’m not able to write output buffer.
var node = context.createScriptProcessor(256,1,1);
node.onaudioprocess = function (e){
var inputBuffer = e.inputBuffer.getChannelData(0);
}
I get data from getChannelData but how to send them to the outputbuffer?
Thanks in advance.
The output buffer is stored in
e.outputBuffer. Basically, you can change the data within this to set what the output gets.E.g. to fill a buffer with random numbers