Wwise SDK 2019.1.11
|
Audio device plug-ins are the endpoints of the audio processing chain. Natural Audio devices are the OS sound systems, but there can be more possible outputs if additional hardware or drivers allow it. The role of the sink plug-in is to take the final mixed audio samples and transfer them to the device, in the format the device understands.
On the sound engine side, writing an audio device plug-in consists of implementing the AK::IAkSinkPlugin
interface. Only the functions specific to this interface are covered there. Refer to How to Create Wwise Sound Engine Plug-ins for information about interface components shared with other plug-in types ( AK::IAkPlugin
interface). Also refer to the provided AkSink plug-in for sample code (Samples).
An audio device is always specified through the plug-in it is using (Audio Device ShareSet) and a specific device ID. This device ID has no meaning for the Wwise sound engine, it is for the sole purpose of the plug-in implementor to discriminate devices where many of the same type exists. It is passed by the game through the AkOutputSettings::idDevice
parameter used in AK::SoundEngine::Init
and AK::SoundEngine::AddOutput
. For example, an audio device plug-in which would access Windows' audio devices could probably see many Windows' devices on a particular computer.
If your device doesn't need to discriminate between multiple devices, you can ignore that parameter. However, if you need to implement this, be aware that you MUST also support the "default device" concept, which is selected when the idDevice
parameter is 0
. Whether the first available device or a specific device is selected when receiving 0
is up to the plug-in programmer.
When a plug-in is used in the Wwise authoring application, parameters are updated regularly, whether or not the parameter supports RTPCs. This allows the plug-in to support runtime value changes of non-RTPC values if desired for Wwise usage. If you do not want your plug-in to support this at design-time, you should make a copy of the parameter values at initialization time to ensure they remain the same throughout the plug-in's duration.
As any other plug-in, sink plug-ins need an authoring DLL counterpart. Please refer to How to Create a Wwise Plug-in DLL for the basic setup of the Wwise authoring component common to all plug-ins. Additionally, sink plug-ins can have an extra function exported from the DLL: AkGetSinkPluginDevices
. This function's purpose is to fill the possible devices a user can select in the authoring tool to test, in the Audio Hardware Preferences dialog. This function is optional. If not implemented, it is expected that the plug-in will initialize to a "default" output when required.
AkGetSinkPluginDevices
will be called by Wwise with the plug-in ID, a pre-allocated array of OutputDeviceDescriptor
and the maximum size of the array. The maximum length of the device name is AK_MAX_OUTPUTDEVICEDESCRIPTOR
(256 characters). You must modify the count (io_uMaxCount
) to reflect the number of descriptors correctly filled.
This function must be exported from the DLL, usually by adding a line in the DEF file, as seen below:
Note: If you want to expose your plug-in in Unity or Unreal, don't forget to create a runtime dynamic library (DLL, SO, DYLIB). This is different from the authoring DLL. See Dynamic Libraries. |
After implementing the Wwise part of the plug-in (Writing the Wwise Authoring Part of an Audio Plug-in) and the sound engine part, you can test your plug-in following these steps:
AK::SoundEngine::GetIDFromString
.For example:
Alternatively, you can use your Audio Device plug-in with AK::SoundEngine::AddOutput
.
For more information, refer to the following sections:
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise