

SpeechRecognition.maxAlternatives: Sets the number of alternative potential matches that should be returned per result.Final results are good enough for this simple demo. SpeechRecognition.interimResults: Defines whether the speech recognition system should return interim results, or just final results.Setting this is good practice, and therefore recommended. SpeechRecognition.lang: Sets the language of the recognition.ntinuous: Controls whether continuous results are captured ( true), or just a single result each time recognition is started ( false).

We also set a few other properties of the recognition instance before we move on: We then add the SpeechGrammarList to the speech recognition instance by setting it to the value of the ammars property. We also create a new speech grammar list to contain our grammar, using the SpeechGrammarList() constructor. This is done using the SpeechRecognition() constructor. The next thing to do is define a speech recogntion instance to control the recognition for our application. Plugging the grammar into our speech recognition For this basic demo, we are just keeping things simple.


Var colors = var grammar = '#JSGF V1.0 grammar colors public = ' + colors.
