Hardcoded tts and stt to english.
This commit is contained in:
parent
6099fc651c
commit
6250645fa4
@ -84,7 +84,7 @@ class STTButton extends HTMLElement {
|
||||
this._recognition = new SpeechRecognition();
|
||||
this._recognition.continuous = true;
|
||||
this._recognition.interimResults = true;
|
||||
this._recognition.lang = navigator.language || 'en-US';
|
||||
this._recognition.lang = 'en-US';
|
||||
|
||||
this._recognition.onstart = () => {
|
||||
this._isListening = true;
|
||||
|
||||
@ -99,13 +99,7 @@ class TTSButton extends HTMLElement {
|
||||
|
||||
console.log('TTS: Loaded', this._voices.length, 'voices');
|
||||
|
||||
const lang = navigator.language || '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));
|
||||
}
|
||||
this._selectedVoice = this._voices.find(v => v.lang === 'en-US');
|
||||
if (!this._selectedVoice) {
|
||||
this._selectedVoice = this._voices.find(v => v.lang.startsWith('en'));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user