Spaces:
Running
Running
Update index.html
Browse files- index.html +12 -1
index.html
CHANGED
@@ -317,7 +317,18 @@
|
|
317 |
}
|
318 |
});
|
319 |
|
320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
const source = audioContext.createMediaStreamSource(microphoneStream);
|
322 |
source.connect(analyser);
|
323 |
|
|
|
317 |
}
|
318 |
});
|
319 |
|
320 |
+
// Enable echo cancellation in audio input
|
321 |
+
microphoneStream = await navigator.mediaDevices.getUserMedia({
|
322 |
+
audio: {
|
323 |
+
echoCancellation: true, // Enable echo cancellation
|
324 |
+
noiseSuppression: true, // Optional: Enable noise suppression
|
325 |
+
autoGainControl: true // Optional: Enable auto gain control
|
326 |
+
}
|
327 |
+
});
|
328 |
+
|
329 |
+
|
330 |
+
//microphoneStream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
331 |
+
|
332 |
const source = audioContext.createMediaStreamSource(microphoneStream);
|
333 |
source.connect(analyser);
|
334 |
|