mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
Merge pull request #11073 from vincent-thevenin/dev
fix: fix issue with call voice recording starting before voice detection
This commit is contained in:
commit
d78fe4decc
1 changed files with 4 additions and 2 deletions
|
|
@ -231,7 +231,6 @@
|
|||
mediaRecorder.onstart = () => {
|
||||
console.log('Recording started');
|
||||
audioChunks = [];
|
||||
analyseAudio(audioStream);
|
||||
};
|
||||
|
||||
mediaRecorder.ondataavailable = (event) => {
|
||||
|
|
@ -245,7 +244,7 @@
|
|||
stopRecordingCallback();
|
||||
};
|
||||
|
||||
mediaRecorder.start();
|
||||
analyseAudio(audioStream);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -321,6 +320,9 @@
|
|||
if (hasSound) {
|
||||
// BIG RED TEXT
|
||||
console.log('%c%s', 'color: red; font-size: 20px;', '🔊 Sound detected');
|
||||
if (mediaRecorder && mediaRecorder.state !== 'recording') {
|
||||
mediaRecorder.start();
|
||||
}
|
||||
|
||||
if (!hasStartedSpeaking) {
|
||||
hasStartedSpeaking = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue