Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(noise-suppression) exit out early if no input data to Worklet

Armel Chesnais51ac3ef64a90
diff --git a/react/features/stream-effects/noise-suppression/NoiseSuppressorWorklet.ts b/react/features/stream-effects/noise-suppression/NoiseSuppressorWorklet.ts
index 2236aa4615..89e7555dd2 100644
--- a/react/features/stream-effects/noise-suppression/NoiseSuppressorWorklet.ts
+++ b/react/features/stream-effects/noise-suppression/NoiseSuppressorWorklet.ts
@@ -106,6 +106,12 @@ class NoiseSuppressorWorklet extends AudioWorkletProcessor {
const inData = inputs[0][0];
const outData = outputs[0][0];
+ // Exit out early if there is no input data (input node not connected/disconnected)
+ // as rest of worklet will crash otherwise
+ if (!inData) {
+ return true;
+ }
+
// Append new raw PCM sample.
this._circularBuffer.set(inData, this._inputBufferLength);
this._inputBufferLength += inData.length;