We have following code.
recorderProcess : function (e) {
var left = e.inputBuffer.getChannelData(0);
var samples = this.resampler.resampler(left);
var leftSix = convertFloat32ToInt16(samples);
var send = G711.encode(leftSix, {
alaw: this.encMode == "alaw" ? true : false
});
vApp.wb.utility.audioSend(send);
}
We are capturing audio (Raw PCM) from browser, encoding to to G711 and sending it over websocket. Problem with this code is that it is making browser Garbage Collector (GC) aggressive.
How can we make GC happier so that it has to do less work?
We tried making variables global but that is not helping us.
UPDATE 1
Ading Live code and Chrome Timeline Memory View.
Aucun commentaire:
Enregistrer un commentaire