MCPcopy Create free account
hub / github.com/Wscats/chrome-devtools-cli / interleave

Function interleave

src/__tests__/MediaStreamRecorder.js:1562–1574  ·  view source on GitHub ↗
(leftChannel, rightChannel)

Source from the content-addressed store, hash-verified

1560 };
1561
1562 function interleave(leftChannel, rightChannel) {
1563 var length = leftChannel.length + rightChannel.length;
1564 var result = new Float32Array(length);
1565
1566 var inputIndex = 0;
1567
1568 for (var index = 0; index < length;) {
1569 result[index++] = leftChannel[inputIndex];
1570 result[index++] = rightChannel[inputIndex];
1571 inputIndex++;
1572 }
1573 return result;
1574 }
1575
1576 function mergeBuffers(channelBuffer, recordingLength) {
1577 var result = new Float32Array(recordingLength);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected