mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix
This commit is contained in:
parent
e442b3b169
commit
8a99eaa68f
@ -243,6 +243,15 @@
|
|||||||
mediaRecorder.start();
|
mediaRecorder.start();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const stopAudioStream = async () => {
|
||||||
|
if (audioStream) {
|
||||||
|
const tracks = audioStream.getTracks();
|
||||||
|
tracks.forEach((track) => track.stop());
|
||||||
|
}
|
||||||
|
|
||||||
|
audioStream = null;
|
||||||
|
};
|
||||||
|
|
||||||
// Function to calculate the RMS level from time domain data
|
// Function to calculate the RMS level from time domain data
|
||||||
const calculateRMS = (data: Uint8Array) => {
|
const calculateRMS = (data: Uint8Array) => {
|
||||||
let sumSquares = 0;
|
let sumSquares = 0;
|
||||||
@ -911,6 +920,8 @@
|
|||||||
<button
|
<button
|
||||||
class=" p-3 rounded-full bg-gray-50 dark:bg-gray-900"
|
class=" p-3 rounded-full bg-gray-50 dark:bg-gray-900"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
|
stopAudioStream();
|
||||||
|
stopVideoStream();
|
||||||
showCallOverlay.set(false);
|
showCallOverlay.set(false);
|
||||||
}}
|
}}
|
||||||
type="button"
|
type="button"
|
||||||
|
Loading…
Reference in New Issue
Block a user