ISpeechPhraseAlternate Interface

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

ISpeechPhraseAlternate

The ISpeechPhraseAlternate automation interface enables applications to retrieve alternate phrase information from a speech recognition (SR) engine, and to update the SR engine's language model to reflect committed alternate changes.

There are two types of speech recognition in SAPI: Command and control (C and C) recognition, which is guided by one or more grammars; and dictation recognition, in which the SR engine uses statistical calculations to determine the most likely recognitions of a requested phrase. It should be noted that the two types are not mutually exclusive, and that applications do not request one type of recognition as opposed to the other. Applications simply request recognition; they can determine after the fact which type of recognition produced a particular recognition result.

Dictation recognition is inherently less accurate than C and C recognition, which is guided by grammars. Because of this, there is a practical need for returning alternate recognition results, and for the user to select an alternate as the correct recognition of the phrase.

By default, the ISpeechRecoResult object contains a single recognition result. If the result was obtained using dictation recognition, then alternate recognitions are available. These results can be accessed using the ISpeechRecoResult.Alternates method. This method returns a specific number of recognitions in an ISpeechPhraseAlternates object. It should be noted that the default recognition result is the first ISpeechPhraseAlternate object in the collection.

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

Automation Interface Elements

The ISpeechPhraseAlternate automation interface contains the following elements:


Properties Description
NumberOfElementsInResult Property Returns the count of phrase elements in the alternate's parent ISpeechRecoResult object.
PhraseInfo Property Returns the ISpeechPhraseInfo object of the alternate's parent ISpeechRecoResult object.
RecoResult Property Returns the alternate's parent ISpeechRecoResult object.
StartElementInResult Property Specifies the starting phrase element of the alternate's parent ISpeechRecoResult object.
Methods Description
Commit Method Specifies that the alternate recognition should replace the recognition selected by the SR engine.