The open architecture of Wwise supports three kinds of plug-ins: source plug-ins, which generate sounds, effect plug-ins, which enhance sounds, and source control plug-ins, which enable the use of source control software within Wwise.
The first two kinds of plug-ins use an XML plug-in description file which allows you to quickly change some of the settings of your plug-in, including default property values, without having to recompile the code. A Wwise plug-in DLL can contain multiple plug-ins, each of which must be described in the associated XML file.
The XML description file for each Wwise plug-in DLL must have the same name as the DLL, except for the XML file extension. For example, if your DLL is named "MyPlugin.dll", then the plug-in description file must be named "MyPlugin.xml".
The XML description file contains information about several aspects of a Wwise plug-in, including:
Below is an example of a simple plug-in XML description file.
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (C) 2006 Audiokinetic Inc. --> <PluginModule> <EffectPlugin Name="Wwise Parametric EQ" CompanyID="0" PluginID="105"> <PluginInfo> <PlatformSupport> <Platform Name="Windows"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Mac"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="iOS"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Xbox360"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="XboxOne"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="PS3"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="PS4"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Wii"> <CanBeInsertOnBusses>false</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>false</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> </PlatformSupport> </PluginInfo> <Properties> <Property Name="OnOffBand1" Type="bool" SupportRTPCType="Exclusive" ForceRTPCCurveSegmentShape="Constant"> <UserInterface DisplayName="Band 1 Enable" /> <DefaultValue>true</DefaultValue> <AudioEnginePropertyID>4</AudioEnginePropertyID> </Property> <Property Name="FilterTypeBand1" Type="int32" SupportRTPCType="Exclusive" ForceRTPCCurveSegmentShape="Constant"> <UserInterface DisplayName="Band 1 Filter Type" /> <DefaultValue>5</DefaultValue> <AudioEnginePropertyID>10</AudioEnginePropertyID> <Restrictions> <ValueRestriction> <Enumeration Type="int32"> <Value DisplayName="Low Pass">0</Value> <Value DisplayName="High Pass">1</Value> <Value DisplayName="Band Pass">2</Value> <Value DisplayName="Notch">3</Value> <Value DisplayName="Low Shelf">4</Value> <Value DisplayName="High Shelf">5</Value> <Value DisplayName="Peaking">6</Value> </Enumeration> </ValueRestriction> </Restrictions> <Dependencies> <PropertyDependency Name="OnOffBand1" Action="Enable"> <Condition> <Enumeration Type="bool"> <Value>1</Value> </Enumeration> </Condition> </PropertyDependency> </Dependencies> </Property> <Property Name="GainBand1" Type="Real32" SupportRTPCType="Exclusive" DataMeaning="Decibels"> <UserInterface DisplayName="Band 1 Gain" Step="0.5" Fine="0.1" Decimals="1" /> <DefaultValue>0</DefaultValue> <AudioEnginePropertyID>1</AudioEnginePropertyID> <Restrictions> <ValueRestriction> <Range Type="Real32"> <Min>-24</Min> <Max>24</Max> </Range> </ValueRestriction> </Restrictions> <Dependencies> <PropertyDependency Name="OnOffBand1" Action="Enable"> <Condition> <Enumeration Type="bool"> <Value>1</Value> </Enumeration> </Condition> </PropertyDependency> </Dependencies> </Property> </Properties> </EffectPlugin> </PluginModule>
Let's look at the various parts of the XML file in detail.
Let's look at the parts of this XML file's header and discuss them in detail.
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (C) 2006 Audiokinetic Inc. -->
The first line of any XML file defines the XML version and encoding. In this case, the XML version is 1.0, and the encoding is UTF-8
. The first line of any Wwise plug-in description file should always be exactly like the one above. The second line is an XML comment, in this case a copyright notice. You can introduce comments in various places in the XML file wherever necessary.
<PluginModule> ... </PluginModule>
The main XML tag in this document is named PluginModule
, and encloses all of the information for the various plug-ins defined in the file.
<EffectPlugin Name="Wwise Parametric EQ" CompanyID="0" PluginID="105" SupportsIsSendModeEffect="false"> ... </EffectPlugin>
The EffectPlugin
tag is the main tag for the definition of a single effect plug-in, while SourcePlugin
is the tag name for source plug-ins.
These tags contain three required attributes:
Name
(mandatory): This string specifies the name of the plug-in as it will appear in Wwise CompanyID
(mandatory): This string must represent a positive integer that respects the following ranges: PluginID
(mandatory): This string must be a positive integer in the range 0-65535. Each PluginID must be unique for a specified CompanyID. SupportsIsSendModeEffect
(optional): (Effect plug-in only) This boolean value indicates if the plug-in supports the send mode by querying AK::IAkEffectPluginContext::IsSendModeEffect() during the initalization part. When IsSendModeEffect() returns true, the plug-in should not output the dry signal, and should ignore the dry level properties. For example, if you are developing two source plug-ins and one effect plug-in for in-house use only, you can pick any CompanyID between 64 and 255, and any three PluginIDs between 0 and 65535. The numbers need not be sequential.
|
Caution: If you base your plug-in on a sample plug-in provided by Audiokinetic (Sample Plug-ins), don't forget to change the CompanyID and PluginIDs to something appropriate. Use your assigned official CompanyID if you have one, or a number between 64 and 255 if you don't. Make sure no PluginIDs are repeated for that CompanyID. |
If two or more PluginIDs are identical for the same CompanyID, Wwise will display an error message on startup. If this happens, change the ID for the new plug-in.
|
Caution: You should never change the CompanyID or PluginID of an existing plug-in, because projects using this plug-in will no longer recognize it. The CompanyID and PluginID are persisted with each instance of a source or effect plug-in, and are used to recreate an instance of the right plug-in when the file is loaded. |
The CompanyID and PluginID attributes correspond to the parameters passed to these functions to identify plug-ins:
AkCreatePlugin()
(see Exported Functions)AkGetSoundEngineCallbacks()
(see Exported Functions)AK::SoundEngine::RegisterPlugin()
|
Note: If more than one plug-in is implemented in the DLL, the XML file will contain multiple EffectPlugin and/or SourcePlugin entries. |
<PlatformSupport> <Platform Name="Windows"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Mac"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="iOS"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Xbox360"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="XboxOne"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="PS3"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="PS4"> <CanBeInsertOnBusses>true</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>true</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> <Platform Name="Wii"> <CanBeInsertOnBusses>false</CanBeInsertOnBusses> <CanBeInsertOnAudioObjects>false</CanBeInsertOnAudioObjects> <CanBeRendered>true</CanBeRendered> <CanBeInsertForFeedback>false</CanBeInsertForFeedback> </Platform> </PlatformSupport>
The PluginInfo/PlatformSupport
section defines the platforms supported by your plug-in. It can contain one or more Platform
tags, each of them specifying the various features supported by a plug-in on each platform. The following features can be specified:
CanBeInsertOnBusses
determines whether the effect can be applied to control and master busses. Typically this will require the effect to support surround audio configuration.CanBeInsertOnAuxBusses
determines whether the effect can be applied to control and master auxilliary busses. Typically this will require the effect to support surround audio configuration. Note that if CanBeInsertOnBusses is already set, the effect is already available on Aux busses.CanBeInsertOnAudioObjects
determines whether the effect can be applied as insert to SFX (must support both mono and stereo processing).CanBeRendered
determines whether the effect can be used for offline rendering or not.CanBeInsertForFeedback
determines whether the effect can be applied to motion SFX.In the current version of Wwise, possible values for the Platform
tags are:
Windows
Xbox360
XboxOne
PS3
PS4
Wii
Mac
iOS
Your plug-in will be available only on the specified platforms within Wwise.
<Properties> ... </Properties>
The Properties
section defines the properties of your plug-in. These properties correspond to the controls (such as sliders and checkboxes) that can be manipulated by the user in your plug-in's user interface, and to the values that the sound engine plug-in code can use to make its computations.
A property is typically defined as follows:
<Property Name="GainBand1" Type="Real32" SupportRTPCType="Exclusive" DataMeaning="Decibels"> <UserInterface DisplayName="Band 1 Gain" Step="0.5" Fine="0.1" Decimals="1" /> <DefaultValue>0</DefaultValue> <AudioEnginePropertyID>1</AudioEnginePropertyID> <Restrictions> <ValueRestriction> <Range Type="Real32"> <Min>-24</Min> <Max>24</Max> </Range> </ValueRestriction> </Restrictions> <Dependencies> <PropertyDependency Name="OnOffBand1" Action="Enable"> <Condition> <Enumeration Type="bool"> <Value>1</Value> </Enumeration> </Condition> </PropertyDependency> </Dependencies> </Property>
The Property
tag itself can contain several attributes, including two that are mandatory:
Name
(mandatory): This is the string used in the Wwise plug-in to identify the property. It is used in the following places: Property
tag in Wwise Project files to persist data related to this property.
|
Caution: Never change the name of an existing property, because projects using your plug-in will lose any value, randomizer or RTPC the user might have set on that property. |
|
Note: The Property Name is not a name that appears in the UI, but you should still make it meaningful because a user might see it in a Project file. The name that appears in the UI is specified by the UserInterface[DisplayName] attribute. |
Type
(mandatory): This is the property type. Possible values are: bool:
Boolean int16:
16-bit integer int32:
32-bit integer Real32:
Single-precision float (32 bit) Real64:
Double-precision float (64 bit) string:
Wide character string SupportRTPCType
(optional): If absent, the property will not support RTPCs. If present, it must be set to Exclusive
, which means the value computed from the RTPC curve has exclusive control over the property's value, completely overriding the value set in the property's control within the dialog (that control will be disabled to make it clear to the Wwise user that it does not have any effect on the property). ForceRTPCCurveSegmentShape
(optional, used with SupportRTPCType
): Restricts the possible segment shapes used in RTPC curves on this property. If not specified, then the user has the freedom to change the shape of any segment within the curve. If specified, possible values are: Constant:
All segments in the curve will use constant interpolation (between two adjacent points, the Y value is the same as that of the left-most point of the pair). Use this when the property represents discreet values such as booleans or enumerations. DataMeaning
(optional): If defined, specifies that the property represents some special type of data, such as decibels.
Possible values are:
Decibels:
This property represents decibels. RTPC curves will use decibel scaling by default, though the user has the option to change between decibel and linear scaling. Decibel scaling affects the way values are interpolated between points. For example, if you have a point at 0 dB and one at -96.3 dB, a linear curve segment evaluated exactly between the two points will produce a value of -48.15 dB when using linear scaling, and around -6 dB when using decibel scaling (corresponding to a halving of amplitude). Frequency:
This property represents a frequency in Hz. Frequency scaling affects the way values are interpolated between points. For example, if you have a point at 1000 Hz and one at 4000 Hz (two octaves above), a linear curve segment evaluated exactly between the two points will produce a value of 2500 Hz when using linear scaling, and a value of 2000 Hz (one octave above) when using frequency scaling. IsVisible
(optional): Default value is true. If absent, the property will be visible in generic editors. Set the IsVisible to false when the property and its value are not meaningful for user, and that you don't want the user to see or modify it in generic editors (for example, in the List View).
|
Note: If you want the sound or effect produced by your plug-in to be set by the Wwise user, and not change during a game, do not set it to support RTPCs. |
The DefaultValue
tag specifies the default value for a property. This default value represents the initial value when creating new instances, and value to which the property is reset when the user clicks on the property's control while holding the CTRL key. This value must match the type (as specified with the Type
attribute in the Property
tag) and range (below) of the property.
|
Tip: XML files can be edited with any text or XML editor. They are located in the same folder as the plug-in DLLs, in the "plugins" folder under the main Wwise installation folder. Wwise users who have custom plug-ins can edit the XML file for their plug-ins to change the default value of a plug-in property without recompiling the plug-in. Developer expertise is not required to make this change. |
The AudioEnginePropertyID
tag identifies this property in the Sound Engine. It must be a positive integer in the range 0-32767. The value you set in the AudioEnginePropertyID
tag corresponds to the AkFXParamID
parameter in AK::IAkEffectParam::SetParam()
, so make sure you keep your property IDs in sync between your implementation of AK::IAkEffectParam::SetParam()
and your plug-in description file.
The UserInterface
element defines attribute that relates to user interface behavior and appearance. The following attributes are all optionals and can be set on the UserInterface
element:
DisplayName
(type:string, default:empty) : Defines the display name of the Property, to be displayed at many places in Wwise. This attribute supersedes the function AK::Wwise::IAudioPlugin::DisplayNameForProp
. It allows Wwise to query the Display Name without having any instance of a plug-in. Decimals
(type:integer, default:0) : Defines the number of digits to display after the decimal point. This value must be a non-negative integer number. If set to 0, then no decimal digits and no point will be displayed. Step
(type:float, default:1) : Defines the amount by which the numeric value changes when moving a slider. This value can be an integer or decimal number, depending on the type of property the control is bound to. Fine
(type:float, default:1) : Defines the amount by which the numeric value changes when moving a slider while holding the SHIFT key. This value can be an integer or decimal number, depending on the type of property the control is bound to. SliderType
(type:integer, default:0) : Define the mapping of the values across a slider range.
Mid
(type:float, default:0) : Defines the value in the [min,max] range that is considered neutral. This value affects the drawing of a slider control. UIMin
(type:float, default:Range's Min) : Defines the minimum value that can initially be set by using the slider. If this value is greater than the one specified with the Min
attribute, then the user can force it to a lower value by entering a value that is smaller than the one specified by this attribute, thus enlarging the range of the control. UIMax
(type:float, default:Range's Max) : Defines the maximum value that can initially be set by using the slider. If this value is lower than the one specified with the Max
attribute, then the user can force it to a larger value by entering a value that is larger than the one specified by this attribute, thus enlarging the range of the control. AutoUpdate
(type:boolean, default:false) : Defines if the value is updated while is moving a slider. Set this attribute to false when updating the value too often cause performance of audio glitch issues. LRMixDisplay
(type:boolean, default:false) : Defines if the value is shown as a special Left-Right balance range style. The value range must be between -100 and +100 and map to a Left to Right balance/mix, where 0 is the Center.
|
Tip: The purpose of the UIMin and UIMax attributes is to make the initial range of the control's slider more usable in cases where the property range is really big. If one of your properties has a big theoretical range, but in general users will use a more restricted range, use the Min/ to set the real range, and the UIMin/ to set the initial range of the slider. |
A property can optionally have any of the 2 following restrictions for its data values.
In a Range
restriction (Restrictions/ValueRestriction/Range section), you can define the range of numeric properties.
In a Enumeration
restriction (Restrictions/ValueRestriction/Enumeration section), you can define a list of possible values, and the display name for each of the values.
For example:
<Restrictions> <ValueRestriction> <Enumeration Type="int32"> <Value DisplayName="Low Pass">0</Value> <Value DisplayName="High Pass">1</Value> <Value DisplayName="Band Pass">2</Value> <Value DisplayName="Notch">3</Value> <Value DisplayName="Low Shelf">4</Value> <Value DisplayName="High Shelf">5</Value> <Value DisplayName="Peaking">6</Value> </Enumeration> </ValueRestriction> </Restrictions>
bool
and string
properties do not need a range. This range is used in various places in Wwise, such as the RTPC Curve Editor, to define the range of the graph on the Y-axis.
The format of this file is described formally in the Plugin.xsd XML Schema file found in the "/Authoring/Data/Schemas" folder under the main Wwise installation folder.
Properties can have zero or many dependencies. Dependencies allow to link properties together, so a property can be enabled or disabled based on the value of another property.
Please note the dependencies are currently only used in the following contexts:
The dependencies are not being used in the Effect Editor. For the time being, property dependencies impacting the enabled or disabled states must be implemented in the user interface of the plug-in.
The following example adds a dependency from "GainBand1" to "OnOffBand1". The "GainBand1" property will be enabled when "OnOffBand1" is set to "True".
<Property Name="GainBand1" ...> <...> <Dependencies> <PropertyDependency Name="OnOffBand1" Action="Enable"> <Condition> <Enumeration Type="bool"> <Value>True</Value> </Enumeration> </Condition> </PropertyDependency> </Dependencies> </Property>
The Condition
element can either contains a Enumeration
element or a Range
element. The Action
attribute specified in the PropertyDependency
element must be "Enable", and specifies the property will be enabled when the condition is matching.
Enumeration
condition:
<Enumeration Type="int32">
<Value>0</Value>
<Value>1</Value>
</Enumeration>
Range
condition:
The InnerTypes
section defines the possible Inner Object Types that you can instantiate and use inside your plug-in. You can define multiple InnerType
inside the InnerTypes
section. Each InnerType
must have a unique name, and plug-in ID. The InnerType
section contains a Properties
section, in which you can define properties in the exact same way you would define plug-in properties.
The Inner Types are practical whenever you need to have multiple instances of an object in your plug-in. For example, you could define the Inner Type Band
for an EQ plug-in, when you have a variable number of EQ bands. Each band would have the same property definition, with different values for each band.
<PluginModule> <EffectPlugin ...> <PluginInfo ...> ... </PluginInfo> <Properties> ... </Properties> <InnerTypes> <InnerType Name="Band" CompanyID="X" PluginID="Y"> <Properties> ... </Properties> </InnerType> </InnerTypes> </EffectPlugin>
|
Note: The properties of Inner Types do not support RTPCs. Therefore, you can't use the SupportRTPCType attribute and AudioEnginePropertyID element. |
|
Note: InnerTypes are only supported inside Source and Effect plug-ins. |
To manipulate the Inner Type instances (Inner Objects) in your plug-in code, you need to use the AK::Wwise::IPluginObjectStore
pointer provided by the framework when AK::Wwise::IAudioPlugin::SetPluginObjectStore() is called at the initialization of your plug-in. The AK::Wwise::IPluginObjectStore
interface provides functions for creating and deleting inner objects. When objects are created, they must be stored in a named list using the insertion and removal functions.
For example, you could create an inner object of type Band
, and store it in the BandList:
// Create a new band AK::Wwise::IPluginPropertySet* pBand = GetObjectStore()->CreateObject( L"Band" ); // Insert the new band in the "BandList" (at the end) GetObjectStore()->InsertObject( L"BandList", (unsigned int)-1, pBand );
|
Note: An inner object can only be stored in a single list. |
See the following topics:
When you add inner objects to the object store, the associated Undo mechanism is automatically created in Wwise. You don't need to implement the undo system on your side. However, to support undo events correctly, you need to update your user interface only at the reception of notifications from the framework. For example, after calling InsertObject
on the IPluginObjectStore
, do not update the UI right-away. Wait for the notification AK::Wwise::IAudioPlugin::NotifyInnerObjectAddedRemoved
to be called on your plug-in. This notification tells you that an object was added or removed from a list. It could come from an action from the user or from the Undo mechanism.
You may also be interested in AK::Wwise::IAudioPlugin::NotifyInnerObjectPropertyChanged
, which is called when the value of a property changes in an inner object.
The persistence in the project work units is automatically handled by Wwise. However, you must implement the serialization of the inner objects in the SoundBanks and for the Sound Engine data. You must serialize the inner objects inside AK::Wwise::IAudioPlugin::GetPluginData
and AK::Wwise::IAudioPlugin::GetBankParameters
.
Refer to the Wwise Source and Effect Plug-in Troubleshooting Guide if you run into any problems.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요