Wwise SDK 2024.1.0
|
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:
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.
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:
AK::Wwise::Plugin::MediaConverter::ConvertFile
AK::Wwise::Plugin::MediaConverter::GetCurrentConversionSettingsHash
Here is an example implementation of the AK::Wwise::Plugin::MediaConverter
functions:
In the plug-in definition file (the plug-in XML file), ensure that the CanReferenceDataFile
element is set to true
.
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. |
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.
Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !
Visitez notre page d'AideEnregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !
Partir du bon pied avec Wwise