Bewerken

Delen via


IKeywordDetectorOemAdapter::GetCapabilities method (keyworddetectoroemadapter.h)

The GetCapabilities method returns the keywords and languages supported by the object.

Syntax

HRESULT GetCapabilities(
  [in]  BOOL         *SupportsUserModels,
  [out] KEYWORDID    **KeywordIds,
  [out] ULONG        *NumKeywords,
  [out] LANGID       **LangIds,
  [out] ULONG        *NumLanguages,
  [out] IMFMediaType **ppMediaType
);

Parameters

[in] SupportsUserModels

A Boolean value that indicates whether user specific training is supported.

[out] KeywordIds

A pointer to an array of keyword IDs supported by the object. The object allocates the array by calling CoTaskMemAlloc. The caller frees the memory by calling CoTaskMemFree.

[out] NumKeywords

The number of keyword IDs in the KeywordIds array.

[out] LangIds

A pointer to an array of language IDs supported by the object. The object allocates the array by calling CoTaskMemAlloc. The caller frees the memory by calling CoTaskMemFree.

[out] NumLanguages

The number of language IDs in the LangIds array.

[out] ppMediaType

The audio format required by IKeywordDetectorOemAdapter::VerifyUserKeyword and IKeywordDetectorOemAdapter::ComputeAndAddUserModelData.

The only valid values for the IMFMediaType are the following:

  • Type = Audio
  • Subtype = IEEE_FLOAT
  • Sampling Rate = 16 kHz
  • Bits = 32
Typically, the OEMDLL calls MFCreateMediaType and MFInitMediaTypeFromWaveFormatEx to obtain an IMFMediaType pointer to return to the caller.

Return value

This method can return one of these values.

Return value Description
S_OK
The function exited successfully.
E_POINTER
The pointer for an output parameter is NULL.
E_INVALIDARG
The pointer to the model data is NULL.

Remarks

The information returned from this routine would normally not change for a given version of the OEMDLL or the user independent model data installed along with it.

The OEMDLL must have internal user independent models for the keywords and languages returned from this method.

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

IKeywordDetectorOemAdapter::ComputeAndAddUserModelData

IKeywordDetectorOemAdapter::VerifyUserKeyword

IMFMediaType

MFCreateMediaType

MFInitMediaTypeFromWaveFormatEx