From 519c9d6fade397dc4d2356bddf4eebf8c73aac39 Mon Sep 17 00:00:00 2001 From: Late Night Defender Date: Fri, 16 May 2025 15:21:02 +0700 Subject: [PATCH] release microphone after pressing stop --- src/App.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App.jsx b/src/App.jsx index 1a2b626..c905f6f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -82,6 +82,12 @@ function App() { const stopRecording = () => { mediaRecorderRef.current.stop(); + + // Stop all tracks on the media stream + if (mediaRecorderRef.current.stream) { + mediaRecorderRef.current.stream.getTracks().forEach(track => track.stop()); + } + setIsRecording(false); };