XAudio2Create function

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

Syntax

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

Parameters

ppXAudio2

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

X2DEFAULT

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

X2DEFAULT

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

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 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

Windows Phone 8.1: This API is supported.

Requirements

   
Target Platform Windows
Header xaudio2.h
Library Xaudio2.lib
DLL Windows.Media.Audio.dll

See Also

How to: Build a Basic Audio Processing Graph

XAudio2 Functions