IKeywordDetectorOemAdapter::BuildArmingPatternData method (keyworddetectoroemadapter.h)

The BuildArmingPatternData method is called by the operating system to build OEM-specific pattern data that includes any keyword and user-specific model data for detection.

Syntax

HRESULT BuildArmingPatternData(
  [in]  IStream                     *UserModelData,
  [in]  KEYWORDSELECTOR             *KeywordSelectors,
  [in]  ULONG                       NumKeywordSelectors,
  [out] SOUNDDETECTOR_PATTERNHEADER **ppPatternData
);

Parameters

[in] UserModelData

A pointer to IStream bound to model data for the KEYWORDSELECTOR values in the KeywordSelectors parameter.

[in] KeywordSelectors

An array of KEYWORDSELECTOR structures identifying the desired set of matches for the keyword detector to arm.

[in] NumKeywordSelectors

The number of items in the KeywordSelectors array. Only one key word selector is supported and this field must be set to one.

[out] ppPatternData

The pattern data for the operating system to pass to the audio driver. The OEMDLL allocates the memory calling CoTaskMemAlloc. The operating system will free the memory by calling CoTaskMemFree.

Return value

This method can return one of these values.

Return value Description
S_OK
The function exited successfully.
E_POINTER
The ModelData pointer is NULL.
E_INVALIDARG
The KeywordId or LangId parameters are invalid.
HRESULT_FROM_WIN32(ERROR_GEN_FAILURE)
The processing was unable to complete.

Remarks

The operating system may call this method at any time. The operating system may also store the returned pattern data to reuse later for the same set of keyword selectors.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows Server 2016
Target Platform Windows
Header keyworddetectoroemadapter.h

See also

CoTaskMemAlloc

CoTaskMemFree

IKeywordDetectorOemAdapter

KEYWORDSELECTOR