ISpSREngine::SetRecoProfile (SAPI 5.3)

Microsoft Speech API 5.3

ISpSREngine::SetRecoProfile

ISpSREngine::SetRecoProfile passes the current active user profile to the engine. 

  
    HRESULT SetRecoProfile(ISpObjectToken   *pProfile
);

Parameters

  • pProfile
    Address of an ISpObjectToken object that contains the recognition profile token information.

Return values

Value
S_OK
E_INVALIDARG
FAILED(hr)

Remarks

RecoProfiles are added or removed using Speech properties in Control Panel.

Engines can query the token and include any information needed about this profile, for example, enrollment or training information. Engine specific information should be stored in a subkey of the recognition profile token named with the engine class ID. This is to avoid conflicts with other engines using the same profile.

In order to provide user enrollment the engine can implement a UI component with the name "UserTraining." To instantiate, click Control Panel->Speech properties->SR tab->Train Profile.

SAPI does not restrict applications from calling ISpRecognizer::SetRecoProfile during the middle of recognition (see ISpSREngine::RecognizeStream). If an SR engine does not allow recognition profile changes during recognition, it should fail the ::SetRecoProfile call gracefully (e.g., return SPERR_ENGINE_BUSY).