Partager via


ISpeechPhraseAlternate Interface (SAPI 5.3)

Microsoft Speech API 5.3

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&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&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.

The ISpeechRecoResult.Alternates 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
NumberOfElementsInResult Property
PhraseInfo Property
RecoResult Property
StartElementInResult Property
Methods
Commit Method