Partilhar via


Navigating Tabular Data

  Microsoft Speech Technologies Homepage

(Application Speech Control Sample)

This sample illustrates using the DataTableNavigator Application Speech Control. The control reads data from an external .xml file. The .xml file contains a number of collections, each storing information about a particular city. Each collection contains the following fields: City, Sky Conditions, High, Low, and Entertainment. The user can navigate the table by saying next, previous, home, first, last, and can control information playback by saying read, repeat, sky condition, high, low, and temperature. The user can also say stop playback, or help, at any time.

One of the main purposes of this sample is to demonstrate how to selectively access information in a data file. This sample uses information stored in five data fields in an .xml file. However, only information in four of the fields can be accessed by the user. This is accomplished by specifying only the selected four field names as values of data field properties of the DataTableNavigator control. The City data field is specified as the value of the DataHeaderFields property, and the Sky Conditions, High, and Low data fields are specified as values of the DataContentFields property. When the application runs, only information from these fields is available to the user; the user cannot access the information stored in the Entertainment field.

The sample also demonstrates how to override automatic selection of the default output collection. Saying temperatures causes the sample to speak the high and low temperature information for the current city, yet the .xml file contains no temperature data field. Instead, the word "temperature" refers to an author-defined collection of data fields (the High and Low data fields).

  • Overriding prompt functions.
  • Adding commands (such as the "Help" and "Stop Playback" commands).
  • Contextual help.
  • Using the ContentTemplate property to organize content output.
  • Using automatic navigation in response to user silence after a short time-out (user silence is interpreted as a "Next" command).
  • Overriding selection of the default output collection.
  • The default commands "Select" and "Header" have been disabled. All other default commands are active.
  • Using data from an .xml source file.

Running the Sample

  1. Open the sample. The application reads the first header.
  2. Test the various available commands:
  • Use navigational commands (next, previous, first, last) to navigate through the data array.
  • Use playback commands (read, repeat, sky condition, high, low and temperature) to control playback of the array content.
  • Say stop playback to stop the playback of content.
  • Say help to hear context-sensitive help messages
  1. Say cancel or done to stop the sample.

Remarks

  • The global "Help" command was added to the default grammar by creating a Command control whose scope includes the DataTableNavigator control.
  • The application interprets user silence as a "Next" command.
  • To add new cities to the data table, open the dataset.xml file (in the TableNavigation subdirectory inside of the Samples directory), copy and paste a complete CityInfo element, and change the values in the copied element.

See Also

Application Speech Controls | DataMember Property | DataSource Property | PromptSelectFunction Property

Navigating Tables Using Speech