Browse Source

Quick updates

master
KaKi87 3 years ago
parent
commit
d0a8ac86e8
  1. 1
      index.css
  2. 16
      index.html

1
index.css

@ -497,6 +497,7 @@ Window
overflow: auto;
max-height: 0;
transition: max-height 0.5s;
white-space: pre;
}
.window > .content span {

16
index.html

@ -74,8 +74,20 @@
let sentence = result[0].transcript;
nlp(sentence, [], result.isFinal);
};
recognition.onerror = err => { if(err.error !== 'no-speech') console.log(err) };
recognition.onend = recognition.start;
recognition.onerror = err => {
if(err.error !== 'no-speech'){}
switch(err.error){
case 'network':
status = 2;
alert(`Voice recongition won't work unless you use Google's official Chrome browser.`);
break;
case 'no-speech':
break;
default:
console.log(err);
}
};
recognition.onend = () => { if(status === 1) recognition.start(); };
recognition.onstart = () => {
if(status === 1) return;
status = 1;

Loading…
Cancel
Save