You can try a couple of things. Firstly, I think you want to say something about "deleting every other element of the interleaved buffer" (converting sound to mono).
To do this, you can save the left or right channel. You can change the rotation function:
function interleave(inputL, inputR){ return inputL;
If you want to keep both channels, but βpanβ them both centers (on a single mono channel), you can do something like:
function interleave(inputL, inputR){ var result = new Float32Array(inputL.length); for (var i = 0; i < inputL.length; ++i) result[i] = 0.5 * (inputL[i] + inputR[i]); return result; }
However, there are potentially many others hosted; you will have to change the encoded sound, denoting stereo for mono. However, I assume that (and I did not use recorder.js, so I do not know its internal actions), line 113/114 in recorderWorker would probably change to 1.
My assumption is that you could just change the two places mentioned here (the interlace function and the place where the channel counter is installed [line 114]), because: interleave and encodeWAV are only called through the exportWAV function, so without touching as the original worker was a recording sound (and he recorded stereo), we hope we will not break it. In this case, we would only make changes to the stored sound.
Jrop
source share