Table of Contents
Wwise SDK 2018.1.11
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
Override the function
AK::Wwise::IAudioPlugin::SetPluginObjectMedia and store the pointer for later use. This function will be called at the initialization of the Wwise plug-in (authoring side). By implementing this function, you will receive an interface to an
IPluginObjectMedia*, which allows to you to manage media files.
You can import media files by calling
AK::Wwise::IPluginObjectMedia::SetMediaSource. When importing media, they will be copied to the plug-in's Original directory and will be managed completely by Wwise. To add a plug-in media file at index 0:
Later, you can call
AK::Wwise::IPluginObjectMedia::InvalidateMediaSource to request a conversion of the media files. Override the function to be notified when the plug-in data changes.
Refer to documentation of functions of
AK::Wwise::IPluginObjectMedia for more information.
You may want to convert your media for runtime. To implement conversion functions, you need to inherit from
AK::Wwise::IPluginMediaConverter and implement the required functions (including
GetCurrentConversionSettingsHash) that will allow you to convert your imported original WAV to an appropriate format for the real-time component.
Once you implement all functions in
AK::Wwise::IPluginMediaConverter, you can override the function
GetPluginMediaConverterInterface() to tell Wwise you want to convert your media.
Here is an example implementation of the
In the plug-in definition file, ensure you have the
CanReferenceDataFile element set to
In the real-time component 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 just as easily be illustrating how to use another plug-in type, such as a source plug-in. In that case, you'd be implementing
In Wwise, all bus Effects are stored in the Init.bnk. To avoid having the Init.bnk be too large, the plug-in media is not automatically added to Init.bnk. You will need to manually add the Effect ShareSet or the bus to a separate SoundBank.