CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoContext

CmdMaxAlternates Property


The CmdMaxAlternates property specifies the maximum number of alternates that will be generated for command and control grammars.

By default, the maximum alternates value is zero, so an application must call this method before attempting to retrieve or depend on alternates for command and control. Not all speech recognition engines support command and control or proprietary grammar alternates. If the particular engine does not support alternates, this method will indicate it has succeeded but the number of alternates returned will always be zero.

CmdMaxAlternates has no effect on dictation alternates. See ISpeechRecoResult.Alternates for information regarding dictation alternates.


Syntax

Set: SpeechRecoContext.CmdMaxAlternates = Long
Get: Long = SpeechRecoContext.CmdMaxAlternates

Parts

SpeechRecoContext
The owning object.
Long
Set: A Long variable setting the maximum number of alternates.
Get: A Long variable retrieving the maximum number of alternates.

Remarks

The current version of the Microsoft speech recognition engine supplied with SAPI 5 does not support command and control alternates. However, other manufacturer's engines may.

Example

The following snippet demonstrates retrieving the current number of alternates. However, because not all engines support the alternates feature, a test is performed beforehand. If the attribute does not exist, the application receives a run-time error of SPERR_NOT_FOUND. The On Error statement provides a graceful handling in that case. If the attribute does exist, no error will occur and cfgAttribute will be valid, even if only as Empty.

The samples assumes a valid RecoResult.

Dim objToken As Object
Set objToken = RecoResult.RecoContext.Recognizer.Recognizer

On Error GoTo ErrorHandler

Dim cfgAttribute As String
cfgAttribute = objToken.GetAttribute("CGFAlternates")

Dim numAlternates As Long
numAlternates = RecoResult.RecoContext.CmdMaxAlternates 
Exit Sub

ErrorHandler:
	'Error handling code here
	Debug.Print Err.Number
End Sub


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web