Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startSpeechRecognition() {
- try {
- SpeechRecognitionService.activate();
- SpeechRecognitionService.setNoMatchCallback((transcript) => {
- console.log(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);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement