File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ function listen() {
13
13
} else {
14
14
//if listening already
15
15
isListening = false ;
16
- document . getElementById ( 'talkBtn' ) . value = "Talk to Ron!" ; //change button text
17
16
document . getElementById ( "ronImg" ) . src = "ron.png" ; //default state
18
17
recognition . abort ( ) //no more listening
18
+ document . getElementById ( 'talkBtn' ) . value = "Stopping..." ; //change button text
19
19
}
20
20
}
21
21
22
22
function speak ( ) {
23
23
if ( isListening ) { //only run if listening
24
- try { //If browser supports the speech recognition feature.
24
+ try { //if browser supports the speech recognition feature
25
25
const instructions = document . getElementById ( "tipTxt" ) ;
26
26
const SpeechRecognition = window . SpeechRecognition || window . webkitSpeechRecognition ;
27
27
const recognition = new SpeechRecognition ( ) ;
@@ -55,6 +55,8 @@ function speak() {
55
55
} catch {
56
56
alert ( "Whoops! Looks like your browser isn't supported." ) ; //only if browser badbad
57
57
} ;
58
+ } else {
59
+ document . getElementById ( 'talkBtn' ) . value = "Talk to Ron!" ; //change button text
58
60
}
59
61
}
60
62
You can’t perform that action at this time.
0 commit comments