ISpSREngine::SetAdaptationData

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpSREngine::SetAdaptationData

ISpSREngine::SetAdaptationData provides the SR engine with text data from the application for language-model adaptation purposes. This method is called when an application calls ISpRecoContext::SetAdaptationData. If the engine does not support this type of adaptation, it should do nothing in this function and return S_OK.

HRESULT SetAdaptationData(
   void          *pvEngineContext,
   const WCHAR   *pAdaptationData,
   const ULONG    cch
);

Parameters

pvEngineContext
[in] Engine's recognition context pointer for the context that is sending the data.
pAdaptationData
[in] Buffer containing the adaptation data. Applications should copy this data before returning from this function if they are going to use this data.
cch
[in] The size, in WCHARs, of the adaptation data in pAdaptationData.

Return values

Value Description
S_OK Function completed successfully.
FAILED(hr) Appropriate error message.

Remarks

Some engines may take considerable processing time to perform language model adaptation. Thus, applications should submit adaptation data in chunks to the engine. The engine can then fire an event SPEI_ADAPTATION to indicate that it can receive more adaptation data.

Engines can either persist the adaptation in the current RecoProfile or reset it every session.