Command Event

Description

Occurs when a (client's) command is chosen by the user.

Syntax

Sub agent_Command(ByVal UserInput)

Value 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 you defined to appear in the Commands Window 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. It is also possible that 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 Name property. 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.

NoteThe Microsoft Command and Control speech recognition engine supports returning values in the parameters of this event. If you use Microsoft Agent with another speech engine, check with the supplier to determine whether their engine supports the Microsoft Speech API interface for returning alternatives and confidence scores.

--------------------------------------------------------