Skip to content

Commit e858206

Browse files
committed
Update ron2.js
1 parent 1ae18ba commit e858206

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ron2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ function listen() {
1313
} else {
1414
//if listening already
1515
isListening = false;
16-
document.getElementById('talkBtn').value = "Talk to Ron!"; //change button text
1716
document.getElementById("ronImg").src = "ron.png"; //default state
1817
recognition.abort() //no more listening
18+
document.getElementById('talkBtn').value = "Stopping..."; //change button text
1919
}
2020
}
2121

2222
function speak() {
2323
if (isListening) { //only run if listening
24-
try { //If browser supports the speech recognition feature.
24+
try { //if browser supports the speech recognition feature
2525
const instructions = document.getElementById("tipTxt");
2626
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
2727
const recognition = new SpeechRecognition();
@@ -55,6 +55,8 @@ function speak() {
5555
} catch {
5656
alert("Whoops! Looks like your browser isn't supported."); //only if browser badbad
5757
};
58+
} else {
59+
document.getElementById('talkBtn').value = "Talk to Ron!"; //change button text
5860
}
5961
}
6062

0 commit comments

Comments
 (0)