Version

menu_open
Wwise SDK 2023.1.8
Adding Media to an Audio Plug-in

The plug-in media system allows a plug-in (effect, source, sink, or mixer) to store binary data files in the project by leveraging the Wwise architecture.

There are many benefits to using plug-in media as opposed to using custom data in the plug-in:

  • Built-in persistence of data
  • Source Control integration (using work-group features)
  • Per platform specific conversion of data allowed
  • End-user selection of SoundBanks to hold the data allowed

Wwise Authoring Plug-in

Managing Plug-in Media

You can request the Object Media service by deriving AK::Wwise::Plugin::RequestObjectMedia in your plug-in backend. This will provide the member m_objectMedia to access the methods of the service. To receive notifications about the object media, such as when it has been changed by the user, derive from AK::Wwise::Plugin::Notifications::ObjectMedia and override the AK::Wwise::Plugin::Notifications::ObjectMedia::NotifyPluginMediaChanged() method.

You can import media files by calling AK::Wwise::Plugin::ObjectMedia::SetMediaSource() . When importing media, it will be copied to the plug-in's "Originals" directory and will be managed completely by Wwise. To add a plug-in media file at index 0:

Override the function NotifyPluginMediaChanged to be notified when the plug-in data changes. NotifyPluginMediaChanged is triggered by any modifications to the media source.

Refer to documentation of functions of AK::Wwise::Plugin::ObjectMedia for more information.

Converting the Media for Runtime

If the plug-in definition file uses CanReferenceDataFile, you must convert your imported original WAV media at runtime to an appropriate format for the real-time component.

To implement conversion functions, inherit from AK::Wwise::Plugin::MediaConverter and implement the required functions:

Here is an example implementation of the AK::Wwise::Plugin::MediaConverter functions:

Plug-in Definition

In the plug-in definition file (the plug-in XML file), ensure that the CanReferenceDataFile element is set to true.

Runtime Plug-In

Using Plug-in Media at Runtime

In the Sound Engine part of your plug-in, when implementing AK::IAkEffectPlugin, you will receive an AK::IAkEffectPluginContext pointer in the Init(...) function. From the AK::IAkEffectPluginContext, you can call AK::IAkPluginContextBase::GetPluginMedia to obtain the converted media that was packaged in Wwise SoundBanks.

Note: This example shows how to use effect plug-in media at runtime. However, it could also illustrate how to use another plug-in type, such as a source plug-in. In that case, you would be implementing AK::IAkSourcePlugin and receiving an AK::IAkSourcePluginContext pointer.

Usage in Wwise

Using Plug-in Media in Bus Effects

In Wwise, all bus Effects are stored in the Init.bnk. To minimize the size of the Init.bnk, plug-in media is not automatically added to the Init.bnk. You must manually add the Effect ShareSet or the bus to a separate SoundBank.

Audiokinetic namespace.
@ AK_Fail
The operation failed.
Definition: AkTypes.h:134
@ ConversionFailed
Definition: Utilities.h:192
AKRESULT
Standard function call result.
Definition: AkTypes.h:131
char AkOSChar
Generic character string.
Definition: AkTypes.h:60
uint8_t AkUInt8
Unsigned 8-bit integer.
virtual void GetPluginMedia(AkUInt32 in_dataIndex, AkUInt8 *&out_rpData, AkUInt32 &out_rDataSize)=0
AKSOUNDENGINE_API AKRESULT Init(const AkCommSettings &in_settings)
#define NULL
Definition: AkTypes.h:46
CPluginInfo PluginInfo
Definition: PluginDef.h:997
Wwise API for general Audio Plug-in's backend.
Definition: AudioPlugin.h:133
ConversionResult
Conversion error code.
Definition: PluginDef.h:147
virtual void NotifyPluginMediaChanged()
This function is called by Wwise when any of the plug-in media changes.
uint32_t AkUInt32
Unsigned 32-bit integer.
HashParams::HashType Compute(const void *in_pData, typename HashParams::SizeType in_dataSize)
Definition: AkFNVHash.h:105
static const AkPluginParamID ALL_PLUGIN_DATA_ID
Definition: IAkPlugin.h:684
Defines the parameters of an audio buffer format.
Definition: AkCommonDefs.h:63

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