DynamicMixer

The dynamic mixer component changes the audio balance of the game at runtime. Its strength lies in the ability to add multiple presets together, each changing the volume or pitch properties of a group component. The properties from each active preset are added together to produce the final volume and pitch values that are then passed to the group components. It is also possible to switch from one preset to another thereby giving a nice, smooth transition of the parameters.

In the dynamic mixer inspector it is possible to create or delete presets that can be called up at any time either from the event trigger component or programmatically using the API.

Inspector Elements

\ \

Properties

\
\

Description

\

AutoAddGroupComponents

\
\

Flag that automatically adds/removes group components

(NOTE: Disabled for the first v2.0 release)

\

Create

\
\

Creates a preset \ with a given name

\

Del

\
\

Deletes the preset

\
\

AddPreset

\

Adds preset \ to the active list

\

RemovePreset

\

Removes preset \ from the active list

Preset

Presets is simply a collection of group presets with a unique name. Presets can be activated at any moment either from the event trigger component or through the API.

Preset

A preset can be persistent which allows it to remain active even when the dynamic mixer receives a reset event action. It can also be activated automatically when an event is posted and remain active for as long as the event is playing. When the event is no longer active the preset will be deactivated.

This is a low CPU usage ducking technique which could be used to replace side-chain when performance is an issue.

Inspector Elements

\ \ \

Properties

\
\

Description

\

Is Persistent

\

If its ticked the preset won’t be removed when the dynamic mixer reset function is called through the event system or API

\

Activate on Event

\

Preset \ will automatically get activated when the event is posted and will remain \ active for the duration of the event.

\

GameObject

\
\

GameObject \ used when checking if an event is active

Group preset

A group preset defines properties that will make a change to an assigned group component. It is possible to change the volume, pitch and specify the duration and curve type (i.e. linear, log, exp) for each property change.

Group preset

Adding presets at runtime

Adding a preset at runtime could be done either through the event trigger component or the API.

Adding presets at runtime

Switch preset at runtime

Sending a “SwitchPreset” event action will cause the mixer to switch from the currently active preset to the target preset.

Switch preset at runtime

Inspector Elements

\

Properties

\
\

Description

\
\

Group Component

\

The group component to be modified

\
\

Volume

\
\

Volume to set in dB

\
\

Pitch

\
\

Pitch to set

\
\

FadeInTime

\

The time it will take to reach the \ volume/pitch values, in seconds

\

FadeInCurve

\

The type of transition curve (0.5 = linear, log < 0.5 > exp

\
\

FadeInTime

\

The time it will take to remove the \ volume/pitch values, in seconds

\

FadeInCurve

\

The type of transition curve (0.5 = linear, log < 0.5 > exp

\