Compartir a través de


Debugging the Tutorial Application

  Microsoft Speech Technologies Homepage

This topic is the last of seven tutorial topics covering tools in the Microsoft Speech Application SDK Version 1.1 (SASDK). This section of the tutorial demonstrates the Validate Solution tool for validating prompts; as well as Telephony Application Simulator (TASim) and Speech Debugging Console for debugging applications. TASim simulates the operation of Telephony Application Services running in Microsoft Speech Server. Speech Debugging Console enables you to monitor and manipulate the data sent to and from your speech-enabled Web application. This tutorial section demonstrates how to open Speech Debugging Console and how to use it to debug your voice-only applications.

For reference information on validating prompts, see Validating Prompts. For reference information on TASim, see Using Telephony Application Simulator as a Client. For reference information on Speech Debugging Console, see Debugging Speech 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 telephony Speech Application Language Tags (SALT) clients.

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

Validating Prompts in the Entire Application

In the last section of the tutorial, the check of the prompts showed that some prompts are not in the prompt database, because the application played them back using the text-to-speech (TTS) engine. In the section Creating Prompts, you recorded all the prompts, and at that point, discovered a missing word in the extractions, "large." Clicking the Add to database button on the Prompt Validation Results window added the phrase with an extraction for "large" for subsequent recording. This section demonstrates how to validate the entire application for prompt coverage, including prompts in prompt functions.

To validate the entire application

  1. On the View menu, select Prompt Validation.

  2. On the toolbar in the Prompt Validation window, click the Do Validate Solution button Do Validate Solution button.

  3. In the tree view on the Solution prompt validation window, select Solution and click OK.
    Visual Studio builds the application, and then displays the Prompt Validation Results window:

    Prompt Validation Results window

    This window shows that there are 12 validation errors in the application.

  4. Click + to expand the results, and click + to expand all the Web project results.
    The Default.aspx page shows 0 errors, so it is not necessary to expand those results. The prompt function file, PizzaPrompts.pf, however, shows 12 errors.

  5. Click + by the prompt function file entry to expand it, and then click + to expand each subordinate entry in turn.

  6. Expand the window to view the entire results.

    The results look like the following illustration.

    Prompt Validation Results window

    From the results, it is apparent that none of the numbers have recorded audio, even though it was clear from the tests of the SML returned by the USPhoneNumber grammar rule that the rule returns numbers as text. The application captures those numbers in text form as semantic information, and plays them back in a prompt, for confirmation. (It also captures them as digits, potentially for display in the customary manner for phone numbers.) Because the numbers have no audio representation, the entire prompt plays using the TTS engine.

    The validate solution function also used the Validation Values from the Prompt Function Editor window to build all the possible combinations of prompts. (The 12 reported errors come from 4 History parameters times 3 size parameters —one for each combination.)

    In this case, each number from zero through nine (including oh in English) requires a separate extraction. Choosing the Add to database button Add to database button in this case adds the phrase with the following extraction marked:

    You ordered a large cheese pizza and your phone number is [four two five five five five zero nine zero zero] Is that correct

    That is not the set of needed extractions. In this case, it is necessary to enter each number individually, and mark it for extraction. Furthermore, it is necessary to use concatenations of extractions because it is a practical impossibility to provide recorded audio for all the approximately eight billion ten-digit U.S. telephone numbers. There are other recording strategies, however, that produce more pleasing results than simple concatenation of single digits. See Recording Audio for further information.

    Further expansion of the results shows the composition of each prompt—that is to say, which extractions are concatenated to form the prompt.

  7. Close the validation windows.

Debugging the Application with TASim and Speech Debugging Console

To debug an application, check the program flow, see what functions are being executed in the script, and perform other debugging tasks, use these two components of SASDK:

  • TASim
    Processes audio input, using the local speech recognition (SR) engine, renders audio output, and, for telephony applications, simulates the receipt and transmission of call-control messages using the Simple Messaging EXtension (SMEX) object.
  • Speech Debugging Console
    Accepts written or spoken phrases, permits modification of the Semantic Markup Language (SML) results to see how dialogue flow changes in response to the modifications, permits modification of confidence scores and semantic tags and values to see how an application handles the modifications, permits sending various errors to an application to test how the application handles them, and accepts dual tone multi-frequency (DTMF) strings.

By default, a voice-only application created with the Speech Web Application Wizard displays both TASim and Speech Debugging Console when starting in debug mode in Visual Studio.

To start debugging the application

  1. On the Visual Studio Tools menu, select Options.

  2. Choose Speech Application SDK from the tree view and then Speech Debugging Console. On the Speech Debugging Console pane, make sure that Play Prompts is selected. This enables the debugger to play the prompts from the application through the speakers or headphones.

  3. Click OK.

  4. On the Debug menu, select Start.
    Visual Studio first builds the debug version of the application. Then TASim appears, looking like the following illustration. TASim To see which languages are installed, and to select different voice and recognition engines, on the Tools menu select Options. The speech application developed in this tutorial uses the default language setting, U.S. English. For more information on debugging speech applications in other languages, see the topic Debugging Voice-only Applications.

  5. The Destination Device drop-down list box contains the 10 most-recently used destination telephone numbers—that is, the numbers that callers dial to connect to the application. The Calling Device number simulates the 10 most-recent numbers of the callers' telephones. For the purposes of the tutorial, type any numbers in Destination Device and Calling Device. The tutorial application has no provision for recognizing these numbers or switching based on these numbers.

  6. Click Dial.

    This simulates a telephone connection to the application. In the tutorial, the WelcomeQA control then becomes active, and the welcoming prompt plays.

    The Dial button becomes inactive and the Hang Up button becomes active. Click the Hang Up button at any subsequent point in the application to simulate a telephone hanging up.

After the welcoming prompt plays, SizeQA becomes active, plays its prompt requesting a pizza size, and then waits for a response. At this point, Speech Debugging Console looks like the following illustration.

Speech Debugging Console

It is now possible to confirm the dialogue flow, and confirm the correct operation of the Cancel command.

To confirm the dialogue flow

  1. In Speech Debugging Console, in the Listen panel, at the end of the Input edit box, click Use Audio.
  2. When Listening appears in the Status text box, speak a valid response to the size prompt.
    Because SizeQA uses bargein, Listening appears before the prompt finishes. After the SR engine processes the audio, the Result text box displays the recognized phrase.
  3. Continue to respond as indicated in steps 1 and 2 to the prompts as they play.
  4. When asked if the responses are correct by the confirmation prompt, respond No.
    The application should begin again with the prompt asking for the size.
  5. Again, respond to the prompts as they play, but at the telephone number prompt, say Cancel.
    The application then plays its cancel prompt, and when it terminates, TASim displays a Telephony Application Simulator Shutdown dialog box.
  6. Click Reload to start the application again.

To simulate input to a prompt

  1. In TASim, click Dial.
  2. In Speech Debugging Console, in the Listen panel, at the end of the Input edit box, click Use Audio.
  3. When Listening appears in the Status text box, speak the response.
    Because SizeQA uses bargein, Listening appears before the prompt finishes. After the SR engine processes the audio, the Result text box displays the recognized phrase.
  4. While the next phone number prompt is playing, on the Options menu, select Edit SML, and then click the SML tab.
  5. Respond to the phone number prompt.
    The returned SML appears in the edit box on the SML tab.
  6. Change the area code to "one two three" in the PhoneNumberText element in the returned SML.
  7. Click Submit to submit the edited SML output.
    ConfirmQA now prompts for confirmation with the text from the edited SML output.
  8. Click Use Audio, and when Listening appears in the Status text box, say Yes.
  9. While the prompt from ThanksQA is playing, click Use Audio, and when Listening appears in the Status text box, say Cancel.
    Command1 plays its cancel prompt, the application terminates, and when it terminates, TASim displays a Telephony Application Simulator Shutdown dialog box.
  10. Click Reload to start the application again.
  11. When the application runs a second time in the debugger, in response to the prompts, simulate exceptions by choosing an exception from the Exceptions drop-down list and clicking Submit.

Note  The TTS engine renders some responses to exceptions.

In Speech Debugging Console, it is possible to view the active grammars, the active commands, the status of the current QA control, the answers to a prompt and the activation order of controls. The Output tab shows the general flow of execution through the application.

To save debugging session logs

It is important to check the behavior of the application for consistency. Rather than manually attempting to reproduce the same application input for consistency checks, it is possible to record an application debugging session and then replay it.

Note  Only debugging sessions using text input, not audio input, play back from log files using the replay tool. To create log files with text input, type responses in the Input edit box of Speech Debugging Console, and click Use Text to send the response to the application.

  1. On the Visual Studio Tools menu, select Options.
  2. In the tree view pane on the left of the Options dialog box, select Speech Application SDK and then Speech Debugging Console.
  3. Under Logging, select Record Log Files.
  4. Click Browse.
  5. In the left pane of Select A Directory to Save Your Log Files, select My Projects.
    The directory with your Visual Studio projects opens.
  6. Double-click Tutorial.
  7. Click Open.

Now any debug session creates a log in that directory.

To replay a debug session

  1. Start a debug session with the tutorial application, respond to the prompts using text input, and end the debug session.
  2. On the taskbar, click Start, point to Programs, point to Microsoft Speech Application SDK Version 1.1, point to Debugging Tools, and then on the shortcut menu, click Speech Debugging Console Log Player.
  3. On Speech Debugging Console Log Player, to the right of the Log file path text box, click Browse to open the Open A Log File dialog box.
  4. In the Open A Log File dialog box, select the relevant XML log file for the debug session, and then click Open.
  5. To replay the selected session, click Start Replay.
  6. - or -
  7. From the Replay menu, click Start.

This procedure concludes the tutorials.

To See
Start from the beginning Creating a Speech Project
Get more information on prompt validation Validating Prompts
Get more information on TASim Using the Telephony Application Simulator as a Client
Get more information on Speech Debugging Console Debugging Speech Applications