Share via


ISpeechPhraseInfo GetText Method (SAPI 5.3)

Microsoft Speech API 5.3

Object: ISpeechPhraseInfo

GetText Method

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

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


Parameters

  • StartElement
    [Optional] Specifies the word position from which to start. If omitted, the first word is used.
  • Elements
    [Optional] Specifies the number of words to retrieve. Default value is -1 indicating all words are retrieved.
  • UseReplacements
    [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.

Remarks

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

Example

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