Version

menu_open
Wwise SDK 2021.1.14
Backend of an Authoring Plug-in

To create the backend for your plug-in, you need to create a class derived from AK::Wwise::Plugin::AudioPlugin. This base class offers the most basic methods for a Wwise Authoring plug-in, including a function to write to a SoundBank.

The main model for your plug-in is the Property Set, but Custom Data can also be managed by the plug-in backend.

class BackendSourcePlugin
{
public:
// AK::Wwise::Plugin::AudioPlugin
const GUID& in_guidPlatform,
) const override;
// AK::Wwise::Plugin::Source
double& out_dblMinDuration,
double& out_dblMaxDuration
) const override;
};
MyPlugin, // Add to container "MyPlugin"
BackendSourcePlugin, // Class to add to the container
SoundEngineSourcePlugin // Sound engine plug-in to which this plug-in corresponds
);

Generating SoundBanks

You must code your plug-in to store its current settings into banks when requested. You can do this by implementing the AK::Wwise::Plugin::AudioPlugin::GetBankParameters() method.

The parameters are written into the SoundBank as a data block. The block is then loaded directly from the SoundBank into your sound engine plug-in's parameter structure. Therefore, you must write the parameters in the same order they are declared in the parameter structure of your sound engine plug-in. For more information, refer to Parameter Node Interface Implementation.

For example, consider the following parameter structure:

// Parameter structure for this effect.
struct AkFXSrcSineParams
{
AkReal32 fFrequency; // Frequency (in Hertz).
AkReal32 fGain; // Gain (in dBFS).
AkReal32 fDuration; // Sustain duration (only valid if finite).
};

The following implementation of AK::Wwise::Plugin::AudioPlugin::GetBankParameters() gets the current value of each property and then uses the appropriate method to write the value with the AK::Wwise::Plugin::DataWriter object received as a parameter. These actions are performed in the same order in which the members are defined in your parameter structure.

bool MySourcePlugin::GetBankParameters(
const GUID& in_guidPlatform,
AK::Wwise::Plugin::DataWriter& in_dataWriter) const
{
bool result = true;
result &= in_dataWriter.WriteReal32(m_propertySet->GetReal32(in_guidPlatform, "Frequency"));
result &= in_dataWriter.WriteReal32(m_propertySet->GetReal32(in_guidPlatform, "Gain"));
result &= in_dataWriter.WriteReal32(m_propertySet->GetReal32(in_guidPlatform, "Duration"));
return result;
}
Note: To get the current value of a property, use the getter functions provided by AK::Wwise::Plugin::PropertySet. The type requested must exactly match the type specified in the XML.

For more information about available methods for writing different types of data, refer to AK::Wwise::Plugin::DataWriter.

Managing Licenses

During SoundBank generation, Wwise queries the plug-ins for the license status they implement with the AK::Wwise::Plugin::License interface. The plug-in can implement AK::Wwise::Plugin::License::GetLicenseStatus to return one of the enumerated values in AK::Wwise::Plugin::LicenseStatus. Additionally, the plug-in can return a message with an associated severity, to be shown in the SoundBank generation log.

Returning LicenseStatus_Unlicensed or LicenseStatus_Expired will prevent the plug-in from being included in a SoundBank.

Plug-ins can implement their own schemes for license validation. Please note that you should never query a server synchronously in this function. The function needs to return an answer immediately.

If your plug-in is registered with Audiokinetic, you can leverage the license system of Wwise. Use the following implementation, which looks up the license status in the Wwise Project License:

AK::Wwise::Plugin::LicenseStatus MyPlugin::GetLicenseStatus(
const GUID& in_guidPlatform,
char* out_pszMessage,
unsigned int in_uiBufferSize)
{
uint32_t uDaysToExpiry;
m_host.GetLicenseStatus(in_guidPlatform, eType, eStatus, uDaysToExpiry);
return eStatus;
}
float AkReal32
32-bit floating point
Definition: AkTypes.h:70
Wwise Authoring Plug-ins - Main include file.
Interface used to write data during sound bank generation.
Definition: HostDataWriter.h:246
bool WriteReal32(float in_value)
Writes a 32-bit, single-precision floating point value.
Definition: HostDataWriter.h:428
LicenseType
License type.
Definition: PluginDef.h:60
Wwise API for general Audio Plug-in's backend.
Definition: Source.h:92
Wwise API for general Audio Plug-in's backend.
Definition: AudioPlugin.h:134
Severity
Log message severity.
Definition: PluginDef.h:104
#define AK_ADD_PLUGIN_CLASS_TO_CONTAINER(ContainerName, WwiseClassName, AudioEngineRegisteredName)
(C++) Adds a Wwise Authoring plug-in and a Sound Engine plug-in to a plug-in container.
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const =0
Return the minimum and maximum duration, in seconds.
virtual bool GetBankParameters(const GUID &in_guidPlatform, DataWriter &in_dataWriter) const
Obtains parameters that will be written to a bank.
Definition: AudioPlugin.h:229
LicenseStatus
License status.
Definition: PluginDef.h:68
Definition: PluginHelpers.h:46

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise