다음을 통해 공유


EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM 콜백 함수(acxelements.h)

EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM 콜백은 키워드 스포터의 암 상태를 설정합니다.

통사론

EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM EvtAcxKeywordspotterAssignArm;

NTSTATUS EvtAcxKeywordspotterAssignArm(
  ACXKEYWORDSPOTTER KeywordSpotter,
  GUID *EventId,
  BOOLEAN Arm
)
{...}

매개 변수

KeywordSpotter

초기화된 기존 ACXKEYWORDSPOTTER 개체입니다. ACX 개체에 대한 자세한 내용은 ACX 개체 요약을 참조하세요. 또한 AcxKeywordSpotterCreate 함수를 참조하세요.

EventId

EventId를 나타내는 GUID에 대한 포인터입니다.

Arm

키워드 검색이 무장되어 있는지 여부를 나타내는 부울 값입니다.

반환 값

호출에 성공하면 STATUS_SUCCESS 반환합니다. 그렇지 않으면 적절한 오류 코드를 반환합니다. 자세한 내용은 NTSTATUS 값 사용참조하세요.

발언

키워드 검색에 대한 일반적인 내용은 음성 활성화 및 다중 음성 도우미 참조하세요.

본보기

사용 예는 다음과 같습니다.

EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM       DspC_EvtAcxKeywordSpotterAssignArm;

PAGED_CODE_SEG
NTSTATUS DspC_EvtAcxKeywordSpotterAssignArm(
    _In_    ACXKEYWORDSPOTTER   KeywordSpotter,
    _In_    GUID *              EventId,
    _In_    BOOLEAN             Arm
)
{
    PAGED_CODE();
    PDSP_KEYWORDSPOTTER_CONTEXT     keywordSpotterCtx;
    CKeywordDetector *              keywordDetector = NULL;

    keywordSpotterCtx = GetDspKeywordSpotterContext(KeywordSpotter);

    keywordDetector = (CKeywordDetector*)keywordSpotterCtx->KeywordDetector;

    RETURN_NTSTATUS_IF_FAILED(keywordDetector->SetArmed(*EventId, Arm));

    // the following code is for example only, after arming the
    // requested keyword we immediately trigger a detection
    // so that the automated tests do not block.
    if (Arm)
    {
        CONTOSO_KEYWORDDETECTIONRESULT detectionResult;

        // notify the keyword detector that we have a notification, to populate
        // timestamp information for this detection.
        keywordDetector->NotifyDetection();

        // fill in the detection specific information
        detectionResult.EventId = *EventId;
        detectionResult.Header.Size = sizeof(CONTOSO_KEYWORDDETECTIONRESULT);
        detectionResult.Header.PatternType = CONTOSO_KEYWORDCONFIGURATION_IDENTIFIER2;
        detectionResult.KeywordStartTimestamp = keywordDetector->GetStartTimestamp();
        detectionResult.KeywordStopTimestamp = keywordDetector->GetStopTimestamp();
        keywordDetector->GetDetectorData(*EventId, &(detectionResult.ContosoDetectorResultData));

        RETURN_NTSTATUS_IF_FAILED(AcxPnpEventGenerateEvent(keywordSpotterCtx->Event, &detectionResult, sizeof(CONTOSO_KEYWORDDETECTIONRESULT)));
    }

    return STATUS_SUCCESS;
}

ACX 요구 사항

최소 ACX 버전: 1.0

ACX 버전에 대한 자세한 내용은 ACX 버전 개요참조하세요.

요구 사항

요구
헤더 acxelements.h
IRQL PASSIVE_LEVEL

참고 항목