reduce speach interval for vocie mode

This commit is contained in:
techartdev
2026-02-21 01:26:05 +02:00
parent 6d37734cf9
commit f65c064569
@@ -1043,7 +1043,9 @@ class OpenClawChatCard extends HTMLElement {
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
this._recognition = new SpeechRecognition();
this._recognition.continuous = this._isVoiceMode;
this._recognition.continuous = false;
this._recognition.interimResults = false;
this._recognition.maxAlternatives = 1;
this._recognition.lang = this._getSpeechRecognitionLanguage();
this._voiceStatus = this._isVoiceMode
? this._wakeWordEnabled
@@ -1088,6 +1090,17 @@ class OpenClawChatCard extends HTMLElement {
}
};
this._recognition.onspeechend = () => {
if (this._voiceStopRequested) {
return;
}
try {
this._recognition.stop();
} catch (e) {
// ignore
}
};
this._recognition.onerror = (event) => {
const err = event?.error || "unknown";
if (err === "aborted") {