Bewerken

Delen via


AcxAudioEngineCreate function (acxelements.h)

The AcxAudioEngineCreate function is used to create an audio engine that that will be associated with a circuit WDFDEVICE device object parent.

Syntax

NTSTATUS AcxAudioEngineCreate(
  ACXCIRCUIT              Object,
  PWDF_OBJECT_ATTRIBUTES  Attributes,
  PACX_AUDIOENGINE_CONFIG Config,
  ACXAUDIOENGINE          *AudioEngine
);

Parameters

Object

A WDFDEVICE object (described in Summary of Framework Objects) that will be associated with the circuit.

Attributes

A WDF_OBJECT_ATTRIBUTES structure that is used to associate the AcxAudioEngine with the parent circuit object. Note that additional WDF attributes such as WDF_EXECUTION_LEVEL or WDF_SYNCHRONIZATION_SCOPE, should not be set using the Attributes parameter as they are a managed by ACX.

Config

An initialized ACX_AUDIOENGINE_CONFIG structure that describes the configuration of the audio engine.

AudioEngine

A pointer to a location that receives the handle to the new ACXAUDIOENGINE object that is used in a render circuit, to represent a DSP. For more information about ACX objects, see Summary of ACX Objects.

Return value

Returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.

Remarks

Example

Example usage is shown below.

    NTSTATUS                        status;
    WDF_OBJECT_ATTRIBUTES           attributes;
    ACX_AUDIOENGINE_CONFIG          audioEngineCfg;

    ACX_AUDIOENGINE_CONFIG_INIT(&audioEngineCfg);

    audioEngineCfg.HostPin = Pins[HostPin];
    audioEngineCfg.OffloadPin = Pins[OffloadPin];
    audioEngineCfg.LoopbackPin = Pins[LoopbackPin];
    audioEngineCfg.VolumeElement = volumeElement;
    audioEngineCfg.MuteElement = muteElement;
    audioEngineCfg.PeakMeterElement = peakmeterElement;
    audioEngineCfg.Callbacks = &audioEngineCallbacks;

    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, CODEC_ENGINE_CONTEXT);
    attributes.ParentObject = Circuit;

    status = AcxAudioEngineCreate(Circuit, &attributes, &audioEngineCfg, AudioEngine);

ACX requirements

Minimum ACX version: 1.0

For more information about ACX versions, see ACX version overview.

Requirements

Requirement Value
Header acxelements.h
IRQL PASSIVE_LEVEL

See also