Version

menu_open
Wwise SDK 2024.1.1
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;
}
Wwise Authoring Plug-ins - Main include file.
Interface used to write data during sound bank generation.
bool WriteReal32(float in_value)
Writes a 32-bit, single-precision floating point value.
float AkReal32
32-bit floating point
LicenseType
License type.
Definition: PluginDef.h:59
Wwise API for general Audio Plug-in's backend.
Definition: Source.h:91
Wwise API for general Audio Plug-in's backend.
Definition: AudioPlugin.h:133
Severity
Log message severity.
Definition: PluginDef.h:109
#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:228
LicenseStatus
License status.
Definition: PluginDef.h:67

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise