From 4d087e2ec7287f3ce9209a8ef3212c66f5bc589d Mon Sep 17 00:00:00 2001 From: Aaron Nelson Date: Sun, 26 Apr 2026 19:02:26 -0400 Subject: [PATCH] Release microphone stream immediately after capture stops --- app/capture/page.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/capture/page.tsx b/app/capture/page.tsx index c2c0fd8..70b070d 100644 --- a/app/capture/page.tsx +++ b/app/capture/page.tsx @@ -55,6 +55,10 @@ export default function CapturePage() { const mr = new MediaRecorder(streamRef.current, { mimeType }); mr.ondataavailable = e => { if (e.data.size > 0) chunksRef.current.push(e.data); }; mr.onstop = async () => { + // Release microphone immediately after stopping + streamRef.current?.getTracks().forEach(t => t.stop()); + streamRef.current = null; + if (chunksRef.current.length === 0) return; setState('transcribing'); try {