Speech Automation 5.1
Interface: ISpeechPhraseInfo
GrammarId Property
The GrammarId property returns the ID of the grammar that contains the top-level rule used to recognize the phrase.
The grammar ID is set with ISpeechRecoContext.CreateGrammar.Syntax
Set: | (This property is read-only) |
Get: | Variant = ISpeechPhraseInfo.GrammarId |
Parts
- ISpeechPhraseInfo
- The owning object.
- Variant
-
Set: (This property is read-only)
Get: A Variant variable that gets the property.
Example
The following code snippet assumes a valid recognition RecoResult, although it still checks for validity. GrammarId is the file containing the current match, in this case "10."
Public g As ISpeechRecoGrammar
Set g = RecoResult.CreateGrammar(10)
'Speech processing code here
If Not RecoResult Is Nothing Then
Dim rp As ISpeechPhraseInfo
Set rp = RecoResult.PhraseInfo
MsgBox "Grammar ID: " & rp.GrammarId
End If