I am trying to use speech recognition to trigger reco.speechrecognized events on ANY number announcement
currently I have had success with using dictionary
reco.SetInputToDefaultAudioDevice()
Dim gram As New Recognition.SrgsGrammar.SrgsDocument
Dim callRule As New Recognition.SrgsGrammar.SrgsRule("numbers)
Dim termList As New Recognition.SrgsGrammar.SrgsOneOf("one", "two", "three", "four", "five")
callRule.Add(termList)
gram.Rules.Add(callRule)
gram.Root = callRule
reco.LoadGrammar(New Recognition.Grammar(gram))
reco.RecognizeAsync()
obviously that would be horrible to create an entire dictionary of 0 to 5000
then operating a recognition sub
Private Sub reco_SpeechRecognized(ByVal sender As Object, ByVal e As System.Speech.Recognition.RecognitionEventArgs) Handles reco.SpeechRecognized
Select Case e.Result.Text
Case "one"
'action
Case "two"
'action
'etc
End select
End sub
I ideally want to fire these events regardless of what number was spoken. I essentially would need a statement to replace the select
if e.Result.Text (is a number) then
'number
else
'some other command
end if
is there a better way of doing this