"examples/trials/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "da76b6b0b63058ca8314ff7cd4dbd491828cf6b3"
Commit 404bb3fd authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac: call overlay

parent eacce66a
...@@ -87,7 +87,13 @@ ...@@ -87,7 +87,13 @@
const detectSound = () => { const detectSound = () => {
const processFrame = () => { const processFrame = () => {
if (!mediaRecorder || !$showCallOverlay) return; if (!mediaRecorder || !$showCallOverlay) {
if (mediaRecorder) {
mediaRecorder.stop();
}
return;
}
analyser.getByteTimeDomainData(timeDomainData); analyser.getByteTimeDomainData(timeDomainData);
analyser.getByteFrequencyData(domainData); analyser.getByteFrequencyData(domainData);
...@@ -137,7 +143,7 @@ ...@@ -137,7 +143,7 @@
} }
}; };
const stopRecordingHandler = async () => { const stopRecordingCallback = async () => {
if ($showCallOverlay) { if ($showCallOverlay) {
if (confirmed) { if (confirmed) {
loading = true; loading = true;
...@@ -152,6 +158,9 @@ ...@@ -152,6 +158,9 @@
mediaRecorder = false; mediaRecorder = false;
startRecording(); startRecording();
} else {
audioChunks = [];
mediaRecorder = false;
} }
}; };
...@@ -171,7 +180,7 @@ ...@@ -171,7 +180,7 @@
mediaRecorder.onstop = async () => { mediaRecorder.onstop = async () => {
console.log('Recording stopped'); console.log('Recording stopped');
await stopRecordingHandler(); await stopRecordingCallback();
}; };
mediaRecorder.start(); mediaRecorder.start();
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment