EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM función de devolución de llamada (acxelements.h)
La EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM devolución de llamada establece el estado del brazo del spotter de palabra clave.
Sintaxis
EVT_ACX_KEYWORDSPOTTER_ASSIGN_ARM EvtAcxKeywordspotterAssignArm;
NTSTATUS EvtAcxKeywordspotterAssignArm(
ACXKEYWORDSPOTTER KeywordSpotter,
GUID *EventId,
BOOLEAN Arm
)
{...}
Parámetros
KeywordSpotter
Objeto ACXKEYWORDSPOTTER existente, inicializado. Para obtener más información sobre los objetos ACX, vea Resumen de objetos ACX. Consulte también la función AcxKeywordSpotterCreate.
EventId
Puntero a un GUID que representa el EventId.
Arm
Valor booleano que indica si la detección de palabras clave está armada.
Valor devuelto
Devuelve STATUS_SUCCESS
si la llamada se realizó correctamente. De lo contrario, devuelve un código de error adecuado. Para obtener más información, vea Using NTSTATUS Values.
Observaciones
Para obtener información general sobre la detección de palabras clave, consulte de activación por voz y multiple Voice Assistant.
Ejemplo
A continuación se muestra el uso de ejemplo.
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;
}
Requisitos de ACX
versión mínima de ACX: 1.0
Para obtener más información sobre las versiones de ACX, consulte introducción a la versión de ACX.
Requisitos
Requisito | Valor |
---|---|
encabezado de | acxelements.h |
irQL | PASSIVE_LEVEL |