Table of Contents

Wwise SDK 2018.1.11

◆ Init()

virtual AKRESULT AK::IAkSinkPlugin::Init ( IAkPluginMemAlloc in_pAllocator,
IAkSinkPluginContext in_pSinkPluginContext,
IAkPluginParam in_pParams,
AkAudioFormat io_rFormat 
)
pure virtual

Initialization of the sink plugin.

This method prepares the audio device plug-in for data processing, allocates memory, and sets up initial conditions. The plug-in is passed in a pointer to a memory allocator interface (AK::IAkPluginMemAlloc).You should perform all dynamic memory allocation through this interface using the provided memory allocation macros(refer to Allocating/De-allocating Memory in Audio Plug-ins).For the most common memory allocation needs, namely allocation at initialization and release at termination, the plug-in does not need to retain a pointer to the allocator.It will also be provided to the plug-in on termination. The AK::IAkSinkPluginContext interface allows to retrieve information related to the context in which the audio device plug-in is operated. The plug-in also receives a pointer to its associated parameter node interface (AK::IAkPluginParam).Most plug-ins will want to keep a reference to the associated parameter node to be able to retrieve parameters at runtime. Refer to Communication Between Parameter Nodes and Plug-ins. for more details. All of these interfaces will remain valid throughout the plug-in's lifespan so it is safe to keep an internal reference to them when necessary. Plug-ins also receive the output audio format(which stays the same during the lifespan of the plug-in) to be able to allocate memory and setup processing for a given channel configuration. Note that the channel configuration is suggestive and may even be specified as AkChannelConfig::IsValid() == false.The plugin is free to determine the true channel configuration(this is an io parameter).

Returns
AK_Success if successful.
AK_NotCompatible if the system doesn't support this sink type. Return this if you want to fall back to the default sinks. This sink will never be requested again. Do not return this code if the device is simply unplugged.
AK_DeviceNotCompatible if the requested output device doesn't support this sink type. Return this if you want to fall back to the dummy audio sink wich will result in no audio for the associated bus hierachy. This sink will never be requested again. All other return codes will be treated as temporary failures conditions and the sink will be requested again later.
Parameters
in_pAllocator Interface to memory allocator to be used by the effect.
in_pSinkPluginContext Interface to sink plug-in's context.
in_pParams Interface to plug-in parameters.
io_rFormat Audio data format of the input signal. Note that the channel configuration is suggestive and may even be specified as AkChannelConfig::IsValid() == false. The plugin is free to determine the true channel configuration.