Share via


Centralizing the Settings for Multiple QA Controls

  Microsoft Speech Technologies Homepage

(Dialog Speech Control Sample)

This sample illustrates the use of the SpeechControlSettings Dialog Speech Control. This control enables the application developer to specify, in a single place, the settings for any number of QA controls that are on the same page.

The sample contains two QA controls: one that asks for and recognizes a color name, and another that asks for and recognizes a T-shirt size. The sample starts by asking the user to choose a T-shirt color. The user can answer white, black, red, or blue. After the user speaks a color name, the application next asks the user to choose a T-shirt size. The user can say small, medium, large, or extra large.

The user can also answer either of the QA prompts by saying help. If the user answers help in response to the prompt played by either of the two QA controls, the application treats the user's answer as unrecognized speech, saying either that it did not hear, or did not understand the user's answer.

The sample ends by playing a prompt stating that a T-shirt in the user's selected color and size will be delivered shortly. To continue the demonstration of the SpeechControlSettings control in this sample, change the value of the AllowCommands setting of the SpeechControlSettings control from False to True, rebuild the sample, and then run it again.

The application's behavior changes, in response to the user's request for help, when the AllowCommands property of the SpeechControlSettings control changes. Using the rebuilt sample, if the user says help in response to the prompt played by either of the two QA controls, the application responds by speaking the list of valid responses to that QA (the list of color choices for the first QA, and the list of T-shirt sizes for the second QA).

  • Using a SpeechControlSettings control to affect multiple QA controls
  • Using the AllowCommands property

Running the Sample

Open the sample.

  1. Run the sample and say help while a QA prompt is playing. Note how the sample responds.

  2. Set the AllowCommands property of the SpeechControlSettings control to True.

    To change AllowCommands in SpeechControlSettings:

    1. Double-click Samples.sln, which is located at: C:\Program Files\Microsoft Speech Application SDK 1.1\Applications
    2. In Solution Explorer, expand the CentralizedSettings directory and double-click Page1.aspx
    3. Right-click the control labeled TShirtControlSettings, and select Property Builder...
    4. Expand SpeechControlSettings, then expand QAControlSettings
    5. Click the QAControlSettings that is nested inside the first directory labeled QAControlSettings
    6. Select AllowCommands, and then click OK
  3. Run the sample again and say help while a QA prompt is playing. Note how the sample responds differently than before.

Remarks

  • The "help" command is the only global command supported in this sample.

See Also

Dialog Speech Controls Overview | SpeechControlSettings Control | QA Control | AllowCommands Property