Is it possible and if yes how?
I want to sume multiple float32Arrays into one float32array.
I know this sounds as a stupid question but it turnes out doing this mannually takes quit some time.
Is it possible to make it faster than this?
recBuffers is an array of float32Array buffers with a length of approx 6594048
function mergeBuffers(recBuffers, recLength){
var result = new Float32Array(recLength);
var offset = 0
for (var i=0; i<recBuffers.length; i++){
for (var j=0; j<recBuffers[i].length; j++){
result[j] += recBuffers[i][j];
}
}
return result;
}
From the MDN :
Given two float32Arrays
aandb, you can do this :