Share via


ISpSREngine::SetAdaptationData

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method provides the SR engine with text data from the application for language-model adaptation purposes. SAPI calls this method when an application calls ISpRecoContext::SetAdaptationData. The engine can either persist the adaptation in the current engine recognition context or reset it every session. If the engine does not support the requested type of adaptation, it does nothing in this method and return S_OK.

Some engines can take considerable processing time to do language model adaptation. Thus, applications should submit adaptation data in chunks to the engine. The engine can fire an SPEI_ADAPTATION event to indicate when it finishes a data chunk and is ready to receive more adaptation data.

Syntax

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

Parameters

  • pvEngineContext
    [in] Pointer to the engine recognition context.
  • pAdaptationData
    [in] Pointer to the adaptation data. The application should copy the data before calling this method.
  • cch
    [in] Size, in bytes, of the adaptation data specified by pAdaptationData.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

FAILED(hr)

Appropriate error message.

Requirements

Header sapiddk.h, sapiddk.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpSREngine
SAPI Interfaces