IAPCSpeech::Train

This method trains the application to recognize a user command, and deals with only one command at a time.

Syntax

HRESULT IAPCSpeech::Train( PCWSTR pszTrain, DWORD cbTrain, PCWSTR pszDisplay, DWORD cbDisplay, DWORD d1, DWORD d2 );

Parameters

pszTrain
Pointer to the phrase to train the application to recognize. Support for a list of words may be added in the future.
cbTrain
Byte count of pszTrain.
pszDisplay
Pointer to the null-terminated string that contains the phrase to display. Support for a list of words will be added in the future. This parameter is optional argument and can be NULL.
cbDisplay
Byte count of pszDisplay.
d1
Reserved; set to 0.
d2
Reserved; set to 0.

Return Values

S_FALSE indicates that training was canceled. This can occur if the user chooses ESCAPE during the training or performs an action that causes the form to lose focus, such as pressing the START button.

E_FAIL indicates that training has failed. This can occur if the user does not speak the word within the timeout period.

Remarks

This method results in a pop-up training form to help the user train the application to recognize a word or command. The method is blocked until the training is finished or canceled.