Skip to content

Commit

Permalink
Update speechrecognition.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fustyles authored Oct 9, 2023
1 parent 4eef5e3 commit 6914535
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions SpeechRecognition_20220729/speechrecognition.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,11 @@ if ('webkitSpeechRecognition' in window) {
Recognition_final = linebreak(final_transcript);
//console.log("final = " + Recognition_final);
if (typeof SpeechRecognition_interim === 'object' && SpeechRecognition_interim !== null) {
if (SpeechRecognition_interim.textContent)
SpeechRecognition_interim.textContent = Recognition_final;
else if (SpeechRecognition_interim.innerText)
SpeechRecognition_interim.innerText = Recognition_final;
else if (SpeechRecognition_interim.innerHTML)
SpeechRecognition_interim.innerHTML = Recognition_final;
if (SpeechRecognition_interim.tagName.toLowerCase()=="input"||SpeechRecognition_interim.tagName.toLowerCase()=="textarea")
SpeechRecognition_interim.value = Recognition_final;
else
SpeechRecognition_interim.value = Recognition_final;
}
SpeechRecognition_interim.innerHTML = Recognition_final;
}
}
else {
Recognition_final = "";
Expand All @@ -71,16 +67,10 @@ if ('webkitSpeechRecognition' in window) {
document.body.appendChild(obj);
}
document.getElementById("gamespan_recognition").innerHTML = Recognition_interim;
if (typeof SpeechRecognition_interim === 'object' && SpeechRecognition_interim !== null) {
if (SpeechRecognition_interim.textContent)
SpeechRecognition_interim.textContent = Recognition_interim;
else if (SpeechRecognition_interim.innerText)
SpeechRecognition_interim.innerText = Recognition_interim;
else if (SpeechRecognition_interim.innerHTML)
SpeechRecognition_interim.innerHTML = Recognition_interim;
else
SpeechRecognition_interim.value = Recognition_interim;
}
if (SpeechRecognition_interim.tagName.toLowerCase()=="input"||SpeechRecognition_interim.tagName.toLowerCase()=="textarea")
SpeechRecognition_interim.value = Recognition_interim;
else
SpeechRecognition_interim.innerHTML = Recognition_interim;

//console.log("interim = " + Recognition_interim);
}
Expand Down

0 comments on commit 6914535

Please sign in to comment.