Condividi tramite


EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM funzione di callback (acxelements.h)

Il callback EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM imposta lo stato del braccio dell'elemento spotter della parola chiave.

Sintassi

EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM EvtAcxKeywordspotterAssignArm;

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

Parametri

KeywordSpotter

Oggetto ACXKEYWORDSPOTTER esistente inizializzato. Per altre informazioni sugli oggetti ACX, vedere Riepilogo degli oggetti ACX. Vedere anche la funzione AcxKeywordSpotterCreate .

EventId

Puntatore a un GUID che rappresenta l'EventId.

Arm

Valore booleano che indica se il rilevamento delle parole chiave è armato.

Valore restituito

Restituisce STATUS_SUCCESS se la chiamata ha avuto esito positivo. In caso contrario, restituisce un codice di errore appropriato. Per altre informazioni, vedere Uso dei valori NTSTATUS.

Commenti

Per informazioni generali sul rilevamento delle parole chiave, vedere Attivazione vocale e Assistente vocale multiplo.

Esempio

Di seguito è riportato un esempio di utilizzo.

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;
}

Requisiti di ACX

Versione minima di ACX: 1.0

Per altre informazioni sulle versioni ACX, vedere La panoramica della versione di ACX.

Requisiti

Requisito Valore
Intestazione acxelements.h
IRQL PASSIVE_LEVEL

Vedi anche