Limit the number of time we check if the user is talking or not

This commit is contained in:
Pierre HUBERT 2021-01-31 05:38:02 +01:00
parent 576a7779ed
commit a653eab59d

View File

@ -820,8 +820,17 @@ class CallWindow extends CustomEvents {
const memberEl = this.getMemberNameEl(peerID); const memberEl = this.getMemberNameEl(peerID);
let callsCount = 0;
script_processor_analysis_node.onaudioprocess = (e) => {
// Do not update count each time
callsCount++;
if(callsCount < 5)
return;
callsCount = 0;
script_processor_analysis_node.onaudioprocess = function(e) {
analyzer_node.getByteFrequencyData(freq_data); analyzer_node.getByteFrequencyData(freq_data);
let count = 0; let count = 0;