(inputL, inputR)
| 140 | } |
| 141 | |
| 142 | function interleave(inputL, inputR) { |
| 143 | var length = inputL.length + inputR.length; |
| 144 | var result = new Float32Array(length); |
| 145 | |
| 146 | var index = 0, |
| 147 | inputIndex = 0; |
| 148 | |
| 149 | while (index < length) { |
| 150 | result[index++] = inputL[inputIndex]; |
| 151 | result[index++] = inputR[inputIndex]; |
| 152 | inputIndex++; |
| 153 | } |
| 154 | return result; |
| 155 | } |
| 156 | |
| 157 | function floatTo16BitPCM(output, offset, input) { |
| 158 | for (var i = 0; i < input.length; i++, offset += 2) { |