Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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.
Comment

PREVIOUS NEXT
Code Example
Javascript :: ref in functional components 
Javascript :: javascript get last element in an array 
Javascript :: js random unique id 
Javascript :: react got error need to enable javascript 
Javascript :: iife in javascript 
Javascript :: how to get os theme value in javascript 
Javascript :: build#configuring-commonjs-dependencie 
Javascript :: regex[ress for password 
Javascript :: js search in object 
Javascript :: jquery close 
Javascript :: how to check if input is checked javascript 
Javascript :: react native font awesome 
Javascript :: getting values for metaboxes in wordpress 
Javascript :: ssr full form in nextjs 
Javascript :: react cdn link 
Javascript :: capitalize name function javascript 
Javascript :: Material-ui add photo icon 
Javascript :: sweet alert 2 react 
Javascript :: dom queryselector 
Javascript :: how to change test colo on js button 
Javascript :: multiple styles in react native 
Javascript :: javascript arr.flat 
Javascript :: system navigation bar react native 
Javascript :: react enzyme 
Javascript :: vue electron name and icon 
Javascript :: Javascript - find the largest 
Javascript :: how draw table from json ajax 
Javascript :: An invalid form control with ... is not focusable. 
Javascript :: javascript program to find leap years between two years 
Javascript :: array values js 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =