Command Event

[Microsoft Agent is deprecated as of Windows 7, and may be unavailable in subsequent versions of Windows.]

Description

Occurs when the user chooses a (client's) command.

Syntax

Sub agent_Command (ByVal UserInput**)**

Part Description
UserInput Identifies the Command object returned by the server.
The following properties can be accessed from the Command object:
CharacterID
A string value identifying the name (ID) of the character that received the command.
Name
A string value identifying the name (ID) of the command.
Confidence
A Long integer value indicating the confidence scoring for the command.
Voice
A string value identifying the voice text for the command.
Alt1Name
A string value identifying the name of the next (second) best command.
Alt1Confidence
A Long integer value indicating the confidence scoring for the next (second) best command.
Alt1Voice
A string value identifying the voice text for the next best alternative command match.
Alt2Name
A string value identifying the name of third best command match.
Alt2Confidence
A Long integer identifying the confidence scoring for the third best command match.
Alt2Voice
A string value identifying the voice text for the third best command match.
Count
Long integer value indicating the number of alternatives returned.

Remarks

The server notifies you with this event when your application is input-active and the user chooses a command by spoken input or character's pop-up menu. The event passes back the number of possible matching commands in Count as well as the name, confidence scoring, and voice text for those matches.

If voice input triggers this event, the server returns a string that identifies the best match in the Name parameter, and the second- and third-best match in Alt1Name and Alt2Name . An empty string indicates that the input did not match any command your application defined; for example, it could be one of the server's defined commands. If the command was matched to the Agent's command; for example, Hide, an empty string would be returned in the Name parameter, but you would still receive the text heard in the Voice parameter.

You may get the same command name returned in more than one entry. Confidence, Alt1Confidence , and Alt2Confidence parameters return the relative scores, in the range of -100 to 100, that are returned by the speech recognition engine for each respective match. Voice, Alt1Voice , and Alt2Voice parameters return the voice text that the speech recognition engine matched for each alternative. If Count returns zero (0), the server detected spoken input, but determined that there was no matching command.

If voice input was not the source for the command, for example, if the user selected the command from the character's pop-up menu, the server returns the name (ID) of the command selected in the Nameproperty. It also returns the value of the Confidence parameter as 100, and the value of the Voice parameters as the empty string (""). Alt1Name and Alt2Name also return empty strings. Alt1Confidence and Alt2Confidence return zero (0), and Alt1Voice and Alt2Voice return empty strings. Count returns 1.

Note

Not all speech recognition engines may return all the values for all the parameters of this event. Check with your engine vendor to determine whether the engine supports the Microsoft Speech API interface for returning alternatives and confidence scores.