Merge pull request #52 from joelmathewthomas/fix/exceptions

Fix/exceptions
This commit is contained in:
Joel Mathew Thomas
2025-03-22 22:43:10 +05:30
committed by GitHub
+3
View File
@@ -52,6 +52,8 @@ function UploadPage() {
recorder.onstop = () => { recorder.onstop = () => {
const blob = new Blob(chunks, { type: "audio/wav" }); const blob = new Blob(chunks, { type: "audio/wav" });
const file = new File([blob], "recording.wav", { type: "audio/wav" }); const file = new File([blob], "recording.wav", { type: "audio/wav" });
const tracks = stream.getTracks();
tracks.forEach(track => track.stop());
validateAndSetFile(file); validateAndSetFile(file);
handleUpload(file); handleUpload(file);
}; };
@@ -337,6 +339,7 @@ function UploadPage() {
e.stopPropagation(); // Prevent click from reaching file input e.stopPropagation(); // Prevent click from reaching file input
isRecording ? stopRecording() : startRecording(); isRecording ? stopRecording() : startRecording();
}} }}
disabled={!isConnected}
> >
{isRecording ? "Stop Recording" : "Start Recording"} {isRecording ? "Stop Recording" : "Start Recording"}
</Button> </Button>