XAudio2Create function (xaudio2.h)
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
[out] ppXAudio2
If the operation is successful, returns a pointer to an IXAudio2 object.
[in] Flags
Flags that specify the behavior of the IXAudio2 object. The value of this parameter must be 0.
[in] XAudio2Processor
An XAUDIO2_PROCESSOR-typed value that specifies which CPU to use. If multiple bits are specified, the system will create a separate worker thread for each processor.
XAUDIO2_PROCESSOR default value is XAUDIO2_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.
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
Requirement | Value |
---|---|
Target Platform | Windows |
Header | xaudio2.h |
Library | Xaudio2.lib |
DLL | Windows.Media.Audio.dll |