IKeywordDetectorOemAdapter::ParseDetectionResultData method (keyworddetectoroemadapter.h)

The ParseDetectionResultData method is called by the operating system after handling a keyword detection event and after retrieving the result data from KSPROPERTY_SOUNDDETECTOR_MATCHRESULT. The operating system passes the OEM-specific match result data to this method in order to get the results of a keyword detection. The OEMDLL processes the results and returns information about the matched keyword, the language associated with the matched keyword, and the matched user (if any).

Syntax

HRESULT ParseDetectionResultData(
  [in]  IStream                     *UserModelData,
  [in]  SOUNDDETECTOR_PATTERNHEADER *Result,
  [out] KEYWORDID                   *KeywordId,
  [out] LANGID                      *LangId,
  [out] BOOL                        *pIsUserMatch,
  [out] ULONG64                     *KeywordStartPerformanceCounterValue,
  [out] ULONG64                     *KeywordEndPerformanceCounterValue
);

Parameters

[in] UserModelData

A pointer to IStream bound to model data for the arming pattern.

[in] Result

A pointer to the SOUNDDETECTOR_PATTERNHEADER from the DDI.

[out] KeywordId

Identifies a keyword function. The driver may return 0 to indicate no match.

[out] LangId

Identifies a language.

[out] pIsUserMatch

Indicates if the user matched.

[out] KeywordStartPerformanceCounterValue

Optionally returns the start time of the keyword in terms of the Windows performance counter. The OEMDLL should return 0 if this is not available.

[out] KeywordEndPerformanceCounterValue

Optionally returns the end time of the keyword in terms of the Windows performance counter. The OEMDLL should return 0 if this is not available.

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.
E_HW_RESET
The hardware reset due to an internal fault.

Remarks

If the driver includes any portion of the spoken keyword in the burst keyword/command stream from its keyword detector pin, then the driver must return a valid value for KeywordEndTime. Otherwise the driver may optionally return 0.

If the driver returns KeywordStartTime or KeywordEndTime, the returned values must be consistent with the time stamps returned from the driver’s IMiniportWaveRTInputStream::GetReadPacket routine.

The driver may return valid values for KeywordStartTime and KeywordEndTime regardless of whether the driver includes any portion of the spoken keyword in the burst keyword/command stream.

If the caller receives E_HW_RESET, no keyword was detected by the hardware and the state was lost. A re-arm will be required to get back to a monitoring state.

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

IMiniportWaveRTInputStream::GetReadPacket

KSPROPERTY_SOUNDDETECTOR_MATCHRESULT

SOUNDDETECTOR_PATTERNHEADER