Bewerken

Delen via


AcxStreamAudioEngineCreate function (acxelements.h)

The AcxStreamAudioEngineCreate function is used to create an ACX stream audio engine object that will be associated with an ACX stream object parent. For more information about ACX objects, see Summary of ACX Objects.

Syntax

NTSTATUS AcxStreamAudioEngineCreate(
  ACXSTREAM                     Stream,
  ACXAUDIOENGINE                AudioEngine,
  PWDF_OBJECT_ATTRIBUTES        Attributes,
  PACX_STREAMAUDIOENGINE_CONFIG Config,
  ACXSTREAMAUDIOENGINE          *StreamAudioEngine
);

Parameters

Stream

An ACXSTREAM object that represents an audio stream on a specific circuit's hardware. For more information about ACX objects, see Summary of ACX Objects.

AudioEngine

An ACXAUDIOENGINE object that is used in a render circuit, to represent a DSP. For more information about ACX objects, see Summary of ACX Objects.

Attributes

Additional Attributes defined using a WDF_OBJECT_ATTRIBUTES structure that are used to set various values and to associate the stream audio engine with the parent stream object.

Config

An initialized ACX_STREAMAUDIOENGINE_CONFIG structure that describes the configuration of the stream audio engine.

StreamAudioEngine

A pointer to a location that receives the handle to the newly created ACXSTREAMAUDIOENGINE object. 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;
    ACXSTREAM                       stream;
    ACXELEMENT                      elements[2] = {0};
    ACX_STREAMAUDIOENGINE_CONFIG    audioEngineCfg;

        ACX_STREAMAUDIOENGINE_CONFIG_INIT(&audioEngineCfg);
        audioEngineCfg.VolumeElement = volumeElement;
        audioEngineCfg.MuteElement = muteElement;
        audioEngineCfg.PeakMeterElement = peakmeterElement;
        audioEngineCfg.Callbacks = &streamAudioEngineCallbacks;

        WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, CODEC_STREAMAUDIOENGINE_CONTEXT);
        attributes.ParentObject = stream;

        status = AcxStreamAudioEngineCreate(stream, circuitCtx->AudioEngineElement, &attributes, &audioEngineCfg, (ACXSTREAMAUDIOENGINE*)&elements[0]);

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