IKeywordDetectorOemAdapter::VerifyUserKeyword method (keyworddetectoroemadapter.h)

The VerifyUserKeyword method is used by the training user experience to verify that one instance of a spoken utterance, captured during training, matches a predefined keyword within some tolerance.

Syntax

HRESULT VerifyUserKeyword(
  [in] IStream        *ModelData,
  [in] KEYWORDID      KeywordId,
  [in] LANGID         LangId,
  [in] LONG           KeywordEndBytePos,
  [in] IMFMediaBuffer *UserRecording
);

Parameters

[in] ModelData

A pointer to an IStream object bound to model data for a given stored model. On the initial call this will be empty.

[in] KeywordId

The KEYWORDID in the UserRecording parameter.

[in] LangId

The LANGID of the spoken language in the UserRecording parameter.

[in] KeywordEndBytePos

Indicates the end of the keyword in the UserRecording.

[in] UserRecording

A pointer to the buffer containing the raw data in the appropriate IMFMediaType format.

The user recording must have the following attributes:

  • Type = Audio
  • Subtype = IEEE_FLOAT
  • Sampling Rate = 16 kHz
  • Bits = 32

Return value

This method can return one of these values.

Return code Description
S_OK
The function exited successfully.
E_NOTIMPL
User keyword training is not supported for the device.
E_INVALIDARG
One or more of the following conditions are true:
  • The ModelData pointer is NULL.
  • The KeywordId parameter is invalid.
  • The LangId parameter is invalid.
E_NO_MATCH
The user recording didn't contain the specified keyword.

Remarks

Note that audio is processed in a unique way for voice activation training. The following table summarizes the differences between voice activation training and the regular voice recognition usage.

Training Recognition
Mode Raw Speech
Pin Normal Burst
Audio Format 32-bit float (Type = Audio, Subtype = IEEE_FLOAT, Sampling Rate = 16 kHz, bits = 32) Managed by OS audio stack
Mic Mic 0 All mics in array

Requirements

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

See also

IKeywordDetectorOemAdapter

IMFMediaType

KEYWORDID