This commit is contained in:
aliabid94 2022-07-19 19:37:07 +01:00 committed by GitHub
parent e7e8b6333c
commit 597d22e7b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -53,6 +53,7 @@
export let status: "complete" | "pending" | "error";
export let scroll_to_output: boolean = false;
export let timer: boolean = true;
export let visible: boolean = true;
let el: HTMLDivElement;
@ -120,6 +121,7 @@
<div
class="wrap"
class:opacity-0={!status || status === "complete"}
class:!hidden={!visible}
bind:this={el}
>
{#if status === "pending"}

View File

@ -69,14 +69,14 @@
recording = false;
}
audio_blob = new Blob(audio_chunks, { type: "audio/wav" });
audio_chunks = [];
value = {
data: await blob_to_data_url(audio_blob),
name
};
dispatch(streaming ? "stream" : "change", value);
const audioTracks = stream.getAudioTracks();
audioTracks.forEach((track) => track.stop());
});
inited = true;
}
async function record() {