release microphone after pressing stop

This commit is contained in:
Late Night Defender 2025-05-16 15:21:02 +07:00
parent 97ec6f706f
commit 519c9d6fad

View file

@ -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);
};