Version

menu_open
Wwise SDK 2024.1.1
Integration Details - RTPCs

RTPCs are real time parameters that you can update using the AK::SoundEngine::SetRTPCValue() function. It is your responsibility to set RTPC values, because Event Actions cannot modify them.

RTPC Values

RTPC values are always passed as AkRtpcValue, which represents a 32-bit float value. This value is used to directly interpolate in the RTPC curve the sound designer has previously defined in Wwise.

When parameters are beyond the curve defined in Wwise, the extreme values on the curve are used. If the parameter exceeds the maximum value, the rightmost value of the curve is used, and if the parameter is under the minimum value, the leftmost value of the curve is used. If the RTPC represents a Boolean value, 1 represents True and 0 represents False.

Setting RTPC Values

RTCP values are set as follows:

AkRtpcID in_rtpcID, // ID of the RTPC
AkRtpcValue in_value, // Value to set
AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT // Associated game object ID
);

or

const char * in_pszRtpcName, // Name of the RTPC
AkRtpcValue in_value, // Value to set.
AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT // Associated game object ID
);

or

const wchar_t * in_pszRtpcName, // Name of the RTPC
AkRtpcValue in_value, // Value to set.
AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT // Associated game object ID
);

RTPC values can affect sounds playing on game objects, bus parameters, source plug-ins, and effect plug-ins. We will consider all these possibilities.

Enabling ID Usage

To work with IDs, the banks must be generated with the "Generate header file" option in the Generate SoundBanks dialog box in Wwise. The definition file, named Wwise_IDs.h, contains all the required IDs. It is updated at each bank generation.

RTPCs and Game Objects

RTPCs can be used to modify the behavior of game objects by affecting a Sound SFX, a Sound Voice, a container or an actor-mixer object. Switches can also be modified through the use of RTPCs (refer to Driving Switches).

You can set a global RTPC value for all unassigned game objects with one function call. To do this, call the AK::SoundEngine::SetRTPCValue() method using AK_INVALID_GAME_OBJECT as game object ID, or without specifying an AkGameObjectID parameter. However, once the sound object receives a call to this method using valid AkRtpcID and AkGameObjectID inputs, the game object is considered assigned and will no longer be affected by the global RTPC value.

RTPCs and Busses

In Wwise, some bus parameters can be modified by RTPCs. In general, most usages of RTPCs on bus parameters will require calls to the AK::SoundEngine::SetRTPCValue() method be made with the AK_INVALID_GAME_OBJECT parameter, as explained in RTPCs and Game Objects. This will give all busses a value for that RTPC.

However, if your project uses 3D Positioning for busses, you might want to give specific values to each bus. In this case, provide the Game Object/Listener attached to the bus to the AK::SoundEngine::SetRTPCValue() function.

RTPCs and Plug-Ins

In Wwise, RTPCs can affect the properties of effect and source plug-ins, such as their reverb levels, pitch, or low pass cut-off frequencies. For the RTPC value to correctly affect these properties on busses using the plug-in, the same scenarios explained above in RTPCs and Busses will apply.

If the plug-ins are used in Actor-Mixer or Interactive-Music objects or your project, they will always be played on a Game Object. Most of the time AK::SoundEngine::SetRTPCValue() method should be made with a valid AkGameObjectID value. However, it is still possible to only set a global default value for all Game Objects that don't have one specified directly by using AK_INVALID_GAME_OBJECT.

Note: It is important to note the difference between setting global RTPC values, and setting RTPC values per game object. If a Wwise object playing sounds, such as a switch container, is affected by RTPCs, it is important to make calls to the AK::SoundEngine::SetRTPCValue() method with a valid AkGameObjectID value. On playback, if no such game object-specific value has been set, the sound engine will look for a global RTPC value that will have been set by calling AK::SoundEngine::SetRTPCValue() with the AK_INVALID_GAME_OBJECT parameter or with no specified game object. If this global value does not exist, the sound engine will use the Game Parameter's default value as specified in the Wwise authoring application.
Caution: Note that it is possible to use the same RTPC for sounds, buses, and effects. This may result in unexpected behavior, and we recommend you use different RTPCs for game objects, buses, and effects. For example, in a racing game, you might have set a default RPM value on the engines of ten cars. At the same time, a low pass filter on the bus playing the cars' engine sounds could be applied. If you follow this recommendation, it will be easier for you to identify the source of the low pass filter effect.

For an example of integrating RTPCs, refer to RTPC Example.

AKSOUNDENGINE_API AKRESULT SetRTPCValue(AkRtpcID in_rtpcID, AkRtpcValue in_value, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT, AkTimeMs in_uValueChangeDuration=0, AkCurveInterpolation in_eFadeCurve=AkCurveInterpolation_Linear, bool in_bBypassInternalValueInterpolation=false)
AkUInt32 AkRtpcID
Real time parameter control ID.
Definition: AkTypes.h:73
AkUInt64 AkGameObjectID
Game object ID.
Definition: AkTypes.h:60
AKRESULT
Standard function call result.
Definition: AkTypes.h:134
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:96
AkReal32 AkRtpcValue
Real time parameter control value.
Definition: AkTypes.h:74

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