Partilhar via


Using Global Commands and Context-sensitive Help

  Microsoft Speech Technologies Homepage

(Dialog Speech Control Sample)

This sample illustrates the use of global commands (Help, Repeat, and Main Menu) and how to implement context-sensitive help.

In order to illustrate the "Main Menu" command properly, the sample application has two pages. There is one QA control on each of the two pages. Saying Main Menu at any time before speaking a recognized city name on the second page returns the user to page one.

The help messages that the application plays are context-sensitive. The content of the help message changes depending upon which page the message refers to. The function of the "Repeat" command is context sensitive as well in that the application assumes that the user wants to hear the last bit of useful information. For example, if the user says Repeat in response to an informational question, the application repeats the question. If the user says Repeat in response to a help prompt, the help prompt repeats. However, if the user says Repeat in response to a mumble or silence prompt (a prompt that the application plays upon detecting mumbling or silence), the application plays the main prompt, rather than the apology prompt, "I'm sorry, I didn't understand that."

  • Implementation of the global commands "Help," "Repeat," and "Main Menu."
  • Use of more than one .aspx page in a single application.
  • Use of a prompt function as opposed to inline prompt text.
  • BargeIn (the ability of the user to interrupt the prompt with a response).
  • The use of a welcome prompt with PlayOnce property set to True.

Running the Sample

  1. Open the sample. The application plays a welcome prompt (output only—the application performs no recognition). The welcome prompt is followed by the question: "Would you like to access the information page?"
  2. Answer no to stop the application, or yes to open the second page. When the second page is opened, the application plays the question: "Which city would you like information for?" Say either Boston or Vancouver to hear an informational message and to finish running the sample.
  3. At either of the questions "Would you like to access the information page?" or "Which city would you like information for?" say the command Main Menu and notice that the application returns to the first page asking the question "Would you like to access the information page?" again.
  4. At either of the questions "Would you like to access the information page?" or "Which city would you like information for?" say the command Help and notice that the help message is different for each question.

Remarks

This sample is interesting not because of how it responds to direct answers to the informational questions it plays, but because of how it responds to the global commands "Help," "Repeat," and "Main Menu."

Note

  • Although saying Main Menu causes page one to reappear, the welcome prompt is not played again because the playOnce property of the QA control is set to True.
  • Application response to the "Repeat" command is intelligent and sensitive to the previously-played prompt (the Main, Help, Mumble, or Silence prompt).

This sample does not support:

  • Confirmation of the user's response.

See Also

Dialog Speech Controls Overview | Command Control | QA Control | SemanticMap Control | InlinePrompt Property | PromptSelectFunction Property

Creating Prompt Functions | Voice-only Run-time Behavior