ISpeechPhraseInfo Elements Property

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechPhraseInfo

Elements Property


The Elements property returns information about the elements of the phrase.


Syntax

Set: (This property is read-only)
Get: ISpeechPhraseElements = ISpeechPhraseInfo.Elements

Parts

ISpeechPhraseInfo
The owning object.
ISpeechPhraseElements
Set: (This property is read-only)
Get: An ISpeechPhraseElements variable containing the phrase elements.

Example

The following code snippet assumes a valid recognition, RecoResult, although it still checks for validity. This prepares a string containing the number of elements from the recognized phrase and lists each word. Words are added in both the DisplayText and LexicalForm.

Dim res As String
Dim i As Long

res = "Phrase Elements: Count=" & RecoResult.Elements.Count & vbCr
For i = 0 To RecoResult.Elements.Count - 1
	res = res & RecoResult.Elements(i).AudioStreamOffset & _
	" Text:" & RecoResult.Elements(i).DisplayText & " Lex:" & RecoResult.Elements(i).LexicalForm
Next