diff --git a/src/lib/components/chat/MessageInput/CallOverlay.svelte b/src/lib/components/chat/MessageInput/CallOverlay.svelte index d5977c0eb0..99b05b0fbe 100644 --- a/src/lib/components/chat/MessageInput/CallOverlay.svelte +++ b/src/lib/components/chat/MessageInput/CallOverlay.svelte @@ -43,6 +43,16 @@ let mediaRecorder; let audioStream = null; let audioChunks = []; + let isMuted = false; + + const toggleMute = () => { + isMuted = !isMuted; + if (audioStream) { + audioStream.getAudioTracks().forEach((track) => { + track.enabled = !isMuted; + }); + } + }; let videoInputDevices = []; let selectedVideoInputDeviceId = null; @@ -305,6 +315,12 @@ return; } + if (isMuted) { + rmsLevel = 0; + window.requestAnimationFrame(processFrame); + return; + } + if (assistantSpeaking && !($settings?.voiceInterruption ?? false)) { // Mute the audio if the assistant is speaking analyser.maxDecibels = 0; @@ -943,7 +959,39 @@ {/if} -