Horje
javascript speech recognition Code Example
javascript speech recognition
var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;'
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
speechRecognitionList.addFromString(grammar, 1);
recognition.grammars = speechRecognitionList;

console.log(speechRecognitionList[0].src); // should return the same as the contents of the grammar variable
console.log(speechRecognitionList[0].weight); // should return 1 - the same as the weight set in line 4.




Javascript

Related
how to append item to an array in foreach javascript Code Example how to append item to an array in foreach javascript Code Example
check if array does not contain string js Code Example check if array does not contain string js Code Example
react hook form password validation uppercase Code Example react hook form password validation uppercase Code Example
$.post javascript Code Example $.post javascript Code Example
how to concatenate a string in javascript Code Example how to concatenate a string in javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10