refac: voice recording

This commit is contained in:
Timothy Jaeryang Baek 2025-04-12 17:41:53 -07:00
parent 79dff685ea
commit 40a3e7786b

View File

@ -159,7 +159,7 @@
};
const startRecording = async () => {
startDurationCounter();
loading = true;
stream = await navigator.mediaDevices.getUserMedia({
audio: {
@ -171,6 +171,9 @@
mediaRecorder = new MediaRecorder(stream);
mediaRecorder.onstart = () => {
console.log('Recording started');
loading = false;
startDurationCounter();
audioChunks = [];
analyseAudio(stream);
};