mirror of
https://github.com/open-webui/open-webui
synced 2025-04-24 08:16:02 +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
@ -231,7 +231,6 @@
|
|||||||
mediaRecorder.onstart = () => {
|
mediaRecorder.onstart = () => {
|
||||||
console.log('Recording started');
|
console.log('Recording started');
|
||||||
audioChunks = [];
|
audioChunks = [];
|
||||||
analyseAudio(audioStream);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mediaRecorder.ondataavailable = (event) => {
|
mediaRecorder.ondataavailable = (event) => {
|
||||||
@ -245,7 +244,7 @@
|
|||||||
stopRecordingCallback();
|
stopRecordingCallback();
|
||||||
};
|
};
|
||||||
|
|
||||||
mediaRecorder.start();
|
analyseAudio(audioStream);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -321,6 +320,9 @@
|
|||||||
if (hasSound) {
|
if (hasSound) {
|
||||||
// BIG RED TEXT
|
// BIG RED TEXT
|
||||||
console.log('%c%s', 'color: red; font-size: 20px;', '🔊 Sound detected');
|
console.log('%c%s', 'color: red; font-size: 20px;', '🔊 Sound detected');
|
||||||
|
if (mediaRecorder && mediaRecorder.state !== 'recording') {
|
||||||
|
mediaRecorder.start();
|
||||||
|
}
|
||||||
|
|
||||||
if (!hasStartedSpeaking) {
|
if (!hasStartedSpeaking) {
|
||||||
hasStartedSpeaking = true;
|
hasStartedSpeaking = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user