function floatTo16BitPCM(output, offset, input){
for (var i = 0; i < input.length; i++, offset+=2){
var s = Math.max(-1, Math.min(1, input[i]));
output.
You can change the init function like this, here you can overcome the default browser sample rate to 16000 and also the channels indicating the mono/stereo we can change that one also , if it is mono it will be 1 , other wise two .
function init(config) {
//sampleRate = config.sampleRate;
sampleRate = 16000;
debugger;
//numChannels = config.numChannels;
numChannels = 1;
initBuffers();
}