Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

SpeechRecognitionEngine.UpdateRecognizerSetting Method

Include Protected Members
Include Inherited Members

Updates the values of the current settings for a speech recognition engine managed by a SpeechRecognitionEngine object.

Overload List

  Name Description
Public method UpdateRecognizerSetting(String, Int32) Updates the specified setting for the SpeechRecognitionEngine with the specified integer value.
Public method UpdateRecognizerSetting(String, String) Updates the specified setting for the SpeechRecognitionEngine with the specified integer value.

Top

Remarks

Recognizer settings can contain string, 64-bit integer, or memory address data. The following table describes the settings that are defined for a recognizer that complies with the Microsoft Speech Platform SDK 11. The following settings must have the same range for each recognizer that supports the setting. A recognizer that complies with the Speech Platform SDK 11 is not required to support these settings and can support other settings.

Name

Description

ResourceUsage

Specifies the recognizer's CPU consumption. The range is from 0 to 100. The default value is 50.

CFGConfidenceRejectionThreshold

The speech recognition engine accepts full utterances with confidence scores above or equal to this threshold, and rejects full utterances with phrase confidence scores below this threshold. This property accepts the following values:

  • The value -1 causes the engine to use its default value.

  • A value in the range of 0-100 sets the phrase confidence rejection threshold to the specified value.

If this value is set to 0, the speech recognition accepts all utterances. If this value is set to 100, the speech recognition engine rejects all utterances.

ResponseSpeed

Indicates the length of silence at the end of unambiguous input before the speech recognizer completes a recognition operation. The range is from 0 to 10,000 milliseconds (ms). This setting corresponds to the recognizer's EndSilenceTimeout property. Default = 500ms.

ComplexResponseSpeed

Indicates the length of silence at the end of ambiguous input before the speech recognizer completes a recognition operation. The range is from 0 to 10,000 ms. This setting corresponds to the recognizer's EndSilenceTimeoutAmbiguous property. Default = 750ms.

EngineThreadPriority

Sets the priority of the engine thread(s). The range of permitted values is defined by the OS.

  • The minimum value is min(THREAD_PRIORITY_IDLE,THREAD_PRIORITY_HIGHEST)

  • The maximum value is max(THREAD_PRIORITY_IDLE,THREAD_PRIORITY_HIGHEST)

The values of these constants are in defined winbase.h.

AssumeCFGFromTrustedSource

Bypasses file integrity checks when loading a CFG, to reduce load time. This should *only* be used by applications that can guarantee that the CFG they are loading has previously been compiled by the application (or by another application it trusts) and has been stored in a secure location where it could not be edited by a malicious agent. This property accepts the following values:

  • Value set to 0 = AssumeCFGFromTrustedSource is OFF

  • Value set to 1 = AssumeCFGFromTrustedSource is ON

To dictate the confidence level at which higher values indicate recognized speech, and equal or lower values indicate rejected speech, use CFGConfidenceRejectionThreshold. Recognition results with confidence values greater than or equal to the CFGConfidenceRejectionThreshold trigger a SpeechRecognized event. Recognition results with confidence values less than the CFGConfidenceRejectionThreshold trigger a SpeechRecognitionRejected event.

The confidence scores assigned to words and phrases by the recognition engine become the values of the RecognizedWordUnit.Confidence and RecognizedPhrase.Confidence properties, and are converted to range from 0 to 1, instead of from 0-100.

Property values set using the UpdateRecognizerSetting() methods remain in effect only for the current instance of SpeechRecognitionEngine, after which they revert to their default settings.

To return one of the recognizer's settings, use the QueryRecognizerSetting method.

You can modify how the speech recognition responds to non-speech input using the BabbleTimeout, InitialSilenceTimeout, EndSilenceTimeout, and EndSilenceTimeoutAmbiguous properties.

See Also

Reference

SpeechRecognitionEngine Class

SpeechRecognitionEngine Members

Microsoft.Speech.Recognition Namespace