Node.js examples for Data Type:Float32Array
Merge buffer
'use strict';/*from ww w . jav a 2s . c om*/ /** * @credit https://github.com/mattdiamond/Recorderjs */ function mergeBuffers(channelBuffer, recordingLength){ const result = new Float32Array(recordingLength); const length = channelBuffer.length; let offset = 0; for (let i = 0; i < length; i++){ let buffer = channelBuffer[i]; result.set(buffer, offset); offset += buffer.length; } return result; } module.exports = mergeBuffers;