From 466eea1a4ce2da46eaa37cabcc6d88607d14213f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 14 Oct 2024 14:53:01 -0700 Subject: [PATCH] fix: voice note mic not stopping issue --- src/lib/components/chat/MessageInput/VoiceRecording.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/components/chat/MessageInput/VoiceRecording.svelte b/src/lib/components/chat/MessageInput/VoiceRecording.svelte index f98fc2cb1..981266996 100644 --- a/src/lib/components/chat/MessageInput/VoiceRecording.svelte +++ b/src/lib/components/chat/MessageInput/VoiceRecording.svelte @@ -269,6 +269,13 @@ await mediaRecorder.stop(); } clearInterval(durationCounter); + + if (stream) { + const tracks = stream.getTracks(); + tracks.forEach((track) => track.stop()); + } + + stream = null; };