Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining

ISpeechPhraseInfo GetText Method (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

Object: ISpeechPhraseInfo

GetText Method

The GetText method returns the text from a recognition as a single string.

     [StartElement As Long = 0],
     [Elements As Long = -1],
     [UseReplacements As Boolean = True]
) As String


[Optional] Specifies the word position from which to start. If omitted, the first word is used.
[Optional] Specifies the number of words to retrieve. Default value is -1 indicating all words are retrieved.
[Optional] Indicates if replacement text should be used. An example of a text replacement is speaking the sentence "write new check for twenty dollars." The retrieved replacement text is "write new check for $20." Default value is True. See the SR Engine White Paper for more information on replacements.

Return Value

The GetText method returns a String containing the words in the phrase.


GetText may be used only after a recognition attempt, whether successful (SRERecognition), or unsuccessful (SREFalseRecognition).


Use of the ISpeechPhraseInfo object is demonstrated in a code example at the end of this section.

© 2015 Microsoft