SpeechRecognitionEngine.QueryRecognizerSetting(String) SpeechRecognitionEngine.QueryRecognizerSetting(String) SpeechRecognitionEngine.QueryRecognizerSetting(String) SpeechRecognitionEngine.QueryRecognizerSetting(String) Method


Returns the values of settings for the recognizer.

 System::Object ^ QueryRecognizerSetting(System::String ^ settingName);
public object QueryRecognizerSetting (string settingName);
member this.QueryRecognizerSetting : string -> obj
Public Function QueryRecognizerSetting (settingName As String) As Object


String String String String

The name of the setting to return.


The value of the setting.


The recognizer does not have a setting by that name.


The following example is part of a console application that outputs the values for a number of the settings defined for the recognizer that supports the en-US locale. The example generates the following output.

Settings for recognizer MS-1033-80-DESK:  

  ResourceUsage                  is not supported by this recognizer.  
  ResponseSpeed                  = 150  
  ComplexResponseSpeed           = 500  
  AdaptationOn                   = 1  
  PersistedBackgroundAdaptation  = 1  

Press any key to exit...  

using System;  
using System.Globalization;  
using System.Speech.Recognition;  

namespace RecognizerSettings  
  class Program  
    static readonly string[] settings = new string[] {  

    static void Main(string[] args)  
      using (SpeechRecognitionEngine recognizer =  
        new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")))  
        Console.WriteLine("Settings for recognizer {0}:",  

        foreach (string setting in settings)  
            object value = recognizer.QueryRecognizerSetting(setting);  
            Console.WriteLine("  {0,-30} = {1}", setting, value);  
            Console.WriteLine("  {0,-30} is not supported by this recognizer.",  

      Console.WriteLine("Press any key to exit...");  


Recognizer settings can contain string, 64-bit integer, or memory address data. The following table describes the settings that are defined for a Microsoft Speech API (SAPI)-compliant recognizer. The following settings must have the same range for each recognizer that supports the setting. A SAPI-compliant recognizer 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.
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 = 150ms.
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,000ms. This setting corresponds to the recognizer's EndSilenceTimeoutAmbiguous property. Default = 500ms.
AdaptationOn Indicates whether adaptation of the acoustic model is ON (value = 1) or OFF (value = 0). The default value is 1 (ON).
PersistedBackgroundAdaptation Indicates whether background adaptation is ON (value = 1) or OFF (value = 0), and persists the setting in the registry. The default value is 1 (ON).

To update a setting for the recognizer, use one of the UpdateRecognizerSetting methods.

Applies to

See also