Table of Contents

IXAudio2 * AK::GetWwiseXAudio2Interface (  ) 

Get instance of XAudio2 created by the sound engine at initialization.

Returns:
Non-addref'd pointer to XAudio2 interface. NULL if sound engine is not initialized or XAudio2 is not used. The returned pointer can be of either XAudio 2.7, XAudio 2.8, Xaudio 2.9 depending on the Windows version the game is running on. Use QueryInterface to identify which one and cast appropriately

Returns the current, NON-ADDREF'd, XAudio2 interface currently being used by the Wwise SoundEngine. This should be called only once the SoundEngine has been successfully initialized, otherwise the function will return NULL.

It is the responsibility of the caller to AddRef (and Release) the interface if there is a risk the sound engine be terminated before the caller is done with the interface. This function is not thread safe with AK::SoundEngine::Init() nor AK::SoundEngine::Term().

XAudio2 allows creating multiple instances of XAudio2 objects, so systems are not forced to share the same IXAudio2 object, but can be useful to share some resources.

There can not be more than XAUDIO2_MAX_INSTANCES (8 at the time of writing this) simultaneous instances of XAudio2.

Returns:
Non-addref'd pointer to XAudio2 interface. NULL if sound engine is not initialized.