A good user experience with voice commands (XAML)

Applies to Windows Phone only

Cortana UI in the phone shell for voice commands

In the phone's shell, the voice commands feature is presented to the user by Cortana. Cortana helps users discover which apps on the phone support voice commands, and which voice commands can be used to launch an app.

The What can I say screen

The What can I say screen lists names of apps that support voice commands and an example of a command that can be used to launch each app and initiate an action. The sample command is the contents of an example element that is the child of the CommandSet element in the VCD file. This screen appears when a user presses and holds the Search button to launch Cortana and says, "Help" or "What can I say?", or taps See more.

Tap on an app on the What can I say screen to see a list of the available voice commands that can be used to launch an app.

Cortana's system voice commands

Cortana gives users the ability to access some built-in features of the phone by using certain voice commands. These are the system voice commands and they vary depending on the speech language configured for use with the speech feature on the phone.

Important Note: It's important to be aware of these system voice commands when you are choosing a name for your app, or choosing the optional CommandPrefix element you'll use for your app because of the speech certification requirement, detailed at App policies for Windows Phone.

For a list of the system voice commands sorted by speech language, see System voice commands for Windows Phone 8.

Launching by voice or by text

You can find out whether the voice command that launched your app was actually spoken, or whether it was typed in as text, from the SpeechRecognitionSemanticInterpretation.Properties dictionary using the "commandMode" key. The value of that key will be either "voice" or "text".

Localizing voice commands

A VCD file allows you to specify multiple language versions for the commands used to activate your app and execute a command. You can create multiple CommandSets, each with a different xml:lang attribute to allow your app to be used in different markets. For example, an app for the United States might have a CommandSet for English and a CommandSet for Spanish.

Caution:

To activate an app and initiate an action using a voice command, the app must register a VCD file that contains a CommandSet with a language that matches the speech language that the user selected on the phone. This language is set by the user on the phone's Settings > System > Speech > Speech Language screen.

Handling phone backups

If a phone backup occurs and your app reinstalls automatically, any voice command data is not preserved. To avoid this scenario and to make sure your app's voice command data stays intact, consider initializing your VCD file each time your app launches or activates, or store a setting that indicates if the VCD is currently installed and check the setting each time your app launches or activates.