Hardcoded tts and stt to english.

This commit is contained in:
retoor 2025-12-31 10:32:49 +01:00
parent 6099fc651c
commit 6250645fa4
2 changed files with 2 additions and 8 deletions

View File

@ -84,7 +84,7 @@ class STTButton extends HTMLElement {
this._recognition = new SpeechRecognition(); this._recognition = new SpeechRecognition();
this._recognition.continuous = true; this._recognition.continuous = true;
this._recognition.interimResults = true; this._recognition.interimResults = true;
this._recognition.lang = navigator.language || 'en-US'; this._recognition.lang = 'en-US';
this._recognition.onstart = () => { this._recognition.onstart = () => {
this._isListening = true; this._isListening = true;

View File

@ -99,13 +99,7 @@ class TTSButton extends HTMLElement {
console.log('TTS: Loaded', this._voices.length, 'voices'); console.log('TTS: Loaded', this._voices.length, 'voices');
const lang = navigator.language || 'en-US'; this._selectedVoice = this._voices.find(v => v.lang === 'en-US');
const langPrefix = lang.split('-')[0];
this._selectedVoice = this._voices.find(v => v.lang === lang);
if (!this._selectedVoice) {
this._selectedVoice = this._voices.find(v => v.lang.startsWith(langPrefix));
}
if (!this._selectedVoice) { if (!this._selectedVoice) {
this._selectedVoice = this._voices.find(v => v.lang.startsWith('en')); this._selectedVoice = this._voices.find(v => v.lang.startsWith('en'));
} }