XAudio2Create function

Creates a new XAudio2 object and returns a pointer to its IXAudio2 interface.

Syntax


HRESULT XAudio2Create(
  _Out_  IXAudio2 **ppXAudio2,
  _In_   UINT32 Flags,
  _In_   XAUDIO2_PROCESSOR XAudio2Processor
);

Parameters

ppXAudio2 [out]

If the operation is successful, returns a pointer to an IXAudio2 object.

Flags [in]

Flags that specify the behavior of the IXAudio2 object. The value of this parameter must be 0.

XAudio2Processor [in]

An XAUDIO2_PROCESSOR-typed value that specifies which CPU to use.

XAUDIO2_PROCESSOR default value is XAUDIO2_DEFAULT_PROCESSOR.

Note  Specifying a processor should generally be avoided because it can interfere with the scheduler's ability to schedule threads effectively across processors. Instead, pass the XAUDIO2_DEFAULT_PROCESSOR value (see below).

The special XAUDIO2_DEFAULT_PROCESSOR value causes XAudio2 to use its default processor.

Return value

Returns S_OK if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

Remarks

The DirectX SDK versions of XAUDIO2 supported a flag XAUDIO2_DEBUG_ENGINE to select between the release and 'checked' version. This flag is not supported or defined in the Windows 8 version of XAUDIO2.

Note  No versions of the DirectX SDK contain the xaudio2.lib import library. DirectX SDK versions use COM to create a new XAudio2 object.

Platform Requirements

Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

Windows Phone 8.1: This API is supported.

Requirements

Header

Xaudio2.h

Library

Xaudio2.lib

See also

XAudio2 Functions
How to: Build a Basic Audio Processing Graph

 

 

Community Additions

ADD
Show:
© 2014 Microsoft