Skip to content

Commit

Permalink
fixing everything
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSpahr committed May 29, 2024
1 parent 593ec45 commit ef33872
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

.DS_Store
15 changes: 10 additions & 5 deletions ron2.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function speak() {

recognition.onresult = function(event) {
const current = event.resultIndex;
const transcript = event.results[current][0].transcript; //transcript of what Ron heard.
const transcript = event.results[current][0].transcript; //transcript of what Ron heard

//speak input
document.getElementById("ronImg").src = "speak.gif";
Expand All @@ -42,9 +42,14 @@ function speak() {
speech.rate = 1;
speech.pitch = 0.1; //toggle for max voicage!!

instructions.innerText = '"' + transcript + '"'; //show user what Ron heard.
window.speechSynthesis.speak(speech);
speak(); //loop
instructions.innerText = '"' + transcript + '"'; //show user what Ron heard

window.speechSynthesis.speak(speech); //talk

//handle speech synthesis end event
speech.addEventListener("end", (event) => {
speak(); //keep listening when speech ends
});
};
} catch {
alert("Whoops! Looks like your browser isn't supported."); //only if browser badbad
Expand All @@ -57,5 +62,5 @@ function help() {
}

function about() {
alert("My Talking Ron v0.0.4\n\nProgrammed and designed by John Spahr\ngithub.com/johnspahr");
alert("My Talking Ron v0.0.5\n\nProgrammed and designed by John Spahr\ngithub.com/johnspahr\n\nMade with <3 and vanilla JS!");
}
Binary file modified speak.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef33872

Please sign in to comment.