Share via


Creating the Dialogue Framework

  Microsoft Speech Technologies Homepage

This topic is the third of seven tutorial topics covering tools in the Microsoft Speech Application SDK Version 1.1 (SASDK). This section of the tutorial uses Speech Control Editor, which is the all-purpose tool for assembling a working speech-enabled Web application in Microsoft Visual Studio .NET 2003. Speech Control Editor manipulates ASP.NET Speech Controls that produce Speech Application Language Tags (SALT) and JScript on the client. The developer uses Speech Control Editor to specify prompts to speak to the user, to recognize answers using grammars, and to confirm the answers.

For reference information on Speech Control Editor, see Creating Speech-Enabled Web Pages for an introduction to the topic, and Recognizing and Confirming Answers for specifics on QA controls. In addition, Designing Dialogue Flow contains guidelines for designing voice-only applications.

This sequence of tutorials demonstrates how to build a simple voice-only ASP.NET Web application using the SASDK. Specifically, the tutorials demonstrate building a Start page of an imaginary pizza ordering service, for use by voice-only SALT clients.

The procedures for creating the pizza ordering service application build on each other. Performing the procedures in sequence is therefore important.

Adding Prompts to the Pizza Order Application

Speech QA controls prompt callers for information, and can also recognize the caller's responses. Properties on the QA control also assign information to semantic items for use in responding to the recognized responses. This section of the tutorial creates the basic dialogue structure for the application using a series of QA controls. This structure processes the caller's speech while ordering a pizza. Once this section is complete, it is possible to check the dialogue flow through the application, using the speakers or headset and microphone. This application uses a system-initiative dialogue. In this type of dialogue, the QA controls have prompts which usually try to constrain the caller's responses, and the controls extract only one type of answer.

At this point, the dialogue flow will use the text-to-speech (TTS) voice. The next section of the tutorial adds recorded prompts and a later section adds the semantic information.

Adding QA Controls to the Form

The QA controls go on the form in the Default.aspx page of the application. The WelcomeQA control goes directly onto the design surface, but the rest of the QA controls are contained in an ASPX panel. The panel serves to provide a scope for those controls. A Command control to be added later will use this scope. Because users won't know about the commands available to them until the welcoming prompt has played and enumerated the commands, WelcomeQA should remain outside the scope of the Command control.

Because this is a voice-only application, when Speech Web Application Project Wizard set up the project, it added an AnswerCall control to Default.aspx. This application uses that control, but it is not necessary to modify it in any way for this application. It also added a SemanticMap control. The tutorial will modify this control later.

To add the WelcomeQA control

  1. In Solution Explorer, double-click Default.aspx to display it in the design window.

  2. On the Toolbox, click the Speech tab, and then drag a QA control onto the design canvas.

  3. Right-click the QA control, and select Property Builder from the context menu.

  4. In the ID field in the General section, replace the existing ID with WelcomeQA.

  5. Clear the AllowCommands check box.
    This choice specifies that the application will not allow a Command control to be active simultaneously with this control. At later stage, the tutorial adds a Command control to end the application, but that control should not be active during the introductory prompt, in which callers get information on the commands that they can use.

  6. In the tree view pane on the left, select Voice Output.

  7. Select PlayOnce.
    This selection specifies that the application will play this prompt only once when the caller first calls. Later in the tutorial, as a part of the confirmation strategy, you'll clear this setting for some of the QA controls.

  8. Select Inline Prompt, and enter the following text into the edit field:

    Welcome to Tony's Pizza. Order a pizza now and we'll have it waiting when you arrive. Say Cancel at any time to cancel this order.

    This is the prompt that the application plays when it starts.

  9. Click OK.

The canvas should look like the following illustration:

QA controls

The blue sound wave icon on the control now shows that it has a prompt associated with it.

To add a Panel control

  1. On the Toolbox, click the Web Forms tab, and then drag a Panel onto the design canvas.
  2. In the Properties pane, change the default ID to PizzaPanel.
  3. Delete the text from the panel, and stretch it to hold four controls.

All the remaining QA controls in this application go into the panel to put them into the same scope.

To add the SizeQA control

  1. On the Toolbox, click the Speech tab, and then drag a QA control onto the Panel control on the design canvas.

  2. Right-click the control and select Property Builder.

  3. In the ID field in the General section, replace the existing ID with SizeQA.

  4. Select Voice Output.

  5. Select PlayOnce.

  6. Select Inline Prompt, and enter the following text into the edit field:

    We have small, medium and large sizes. What size would you like?

    This is the prompt that the application plays when this control is active.

  7. Click OK.

To add the Phone and ThanksQA control

Drag two more QA controls onto the Panel control. Set their properties as listed in the following table.

Control Property Value
PhoneQA ID PhoneQA
PhoneQA PlayOnce True
PhoneQA InlinePrompts Please say your telephone number, area code first.
ThanksQA ID ThanksQA
ThanksQA PlayOnce True
ThanksQA InlinePrompts Thanks for your order. Give us your phone number when you arrive and we'll give you your pizza.

The canvas should now look like the illustration below:

QA controls

To check the prompts

It is now possible to check the dialogue flow, using Speech Debugging Console and Telephony Application Simulator (TASim).

  1. On the Debug menu select Start. SASDK builds the application, displays the TASim splash screen, and then opens Speech Debugging Console and Telephony Application Simulator, with TASim on top.

Note  The tutorial covers use of TASim and Speech Debugging Console in the topic Debugging the Tutorial Application.

  1. On TASim, type any numbers in Destination Device and Calling Device. The Call Management numbers represent telephone numbers, and the tutorial application has no provision for recognizing these numbers or switching based on these numbers.
  2. Click Dial. Through your headset or speakers, the application plays back the prompts in all the QA controls, one after the other. The application uses text-to-speech (TTS) synthesis to play the prompts.
  3. In TASim, click Hang Up, then click Exit in the warning dialog box.
  4. Click the Close button (x) at the top right corner of the Speech Debugging Console to close it.

Since the synthesized voice was probably not very satisfactory, the next section of the tutorial covers recording prompts to get more natural speech.

To See
Go to the next step Creating Prompts
Start from the beginning Creating a Speech Project
Get more information on Speech Control Editor Creating Speech-Enabled Web Pages
Get more information on working with QA controls Recognizing and Confirming Answers
Get more information on designing dialogue flow Designing Dialogue Flow