Table of Contents
Wwise SDK 2021.1.1
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
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::NotificationsObjectMedia and override the
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:
After this is done, you can call
AK::Wwise::Plugin::ObjectMedia::InvalidateMediaSource() to request a conversion of the media files.
Override the function
NotifyPluginMediaChanged to be notified when the plug-in data changes.
Refer to documentation of functions of
AK::Wwise::Plugin::ObjectMedia for more information.
You may want to convert your imported original WAV media at runtime to an appropriate format for the real-time component. To implement conversion functions, you need to inherit from
AK::Wwise::Plugin::MediaConverter and implement the required functions:
Here is an example implementation of the
In the plug-in definition file (i.e., the plug-in XML file), ensure you have the
CanReferenceDataFile element set to
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
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.