Properly stop mediaRecorder stream to clear microphone in-use state

This commit is contained in:
Debanjum Singh Solanky
2023-11-26 20:33:26 -08:00
parent 8faa63c3c6
commit 20ef5bfc93
3 changed files with 12 additions and 3 deletions

View File

@@ -618,6 +618,8 @@
});
} else if (mediaRecorder.state === 'recording') {
mediaRecorder.stop();
mediaRecorder.stream.getTracks().forEach(track => track.stop());
mediaRecorder = null;
speakButtonImg.src = './assets/icons/microphone-solid.svg';
speakButtonImg.alt = 'Transcribe';
}