Skip to content

Instantly share code, notes, and snippets.

@VeronicaM
Last active May 4, 2019 20:06
Show Gist options
  • Save VeronicaM/deb6f8c9bc84b8a9cbad95f2a65608ba to your computer and use it in GitHub Desktop.
Save VeronicaM/deb6f8c9bc84b8a9cbad95f2a65608ba to your computer and use it in GitHub Desktop.
Identified spoken words
startSpeechRecognition() {
try {
SpeechRecognitionService.activate();
SpeechRecognitionService.setNoMatchCallback((transcript) => {
this.handleFormInputSubmit(transcript);
});
SpeechRecognitionService.setUnrecognizedCallback((transcript) => {
console.log("I'm not sure, but I think you said, '" + transcript + "'");
window.alert('info ' + "I'm not sure, but I think you said, '" + transcript + "'");
});
SpeechRecognitionService.startRecognition();
} catch (e) {
console.log(e);
window.alert('error ' + e.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment