CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Fader
The "fader" module can automatically modify the volume of a sound being played back by using fade-ins, fade-outs, and crossfades.
CriAtomExPlayer.AttachFader attaches a fader module to a CriAtomExPlayer, which turns it into a player dedicated to crossfades.
This is useful when you want a CriAtomExPlayer to play one Voice at a time and fade automatically.
ADX_A_49_Fader.png
Attention
When using the fader, the play / stop functions are restricted for each player.
For example, if the Cue to be played is set to "First Priority", all Voices from the same player may stop unintentionally.
Please refer to the API reference of CriAtomExPlayer.AttachFader for detailed information about the behavior when a fader is attached.
Overview of the fader operation
The fader is a plugin module for the AtomEx player (CriWare.CriAtomExPlayer).
If you call the CriWare.CriAtomExPlayer.Start function of an AtomEx player while a fader is attached, it provides the following volume control to the sound being played back.

  1. If the sound is fading out, it is stopped immediately.
  2. If the sound is fading in (or is being played), it is faded out from the current volume (and for the duration specified by the CriAtomExPlayer.SetFadeOutTime function).
  3. The new sound data that is assigned to the player is started at volume 0 and is progressively faded in (for the duration specified by the CriAtomExPlayer.SetFadeInTime function).
Note:
If you use the CriAtomExPlayer.Prepare function instead of the CriAtomExPlayer.Start function, the actions described above happen when the pause is canceled.
When the CriAtomExPlayer.Stop function is executed, only a fading out of the sound being played back is executed.
(Operations 1 and 2 above are performed.)
Attention
Due to the specifications of the fader, only the two last playbacks are faded in or out.
Sounds started before those are stopped immediately when the CriAtomExPlayer.Start or the CriAtomExPlayer.Stop functions are executed.
Configurable parameters
You can configure the following parameters for a fader.

Parameters configurable for a fader
Parameter Description
Fade-in time Specifies the fade-in duration, i.e. the time between when the volume starts rising and when it reaches its intended value.
Fade-out time Specifies the fade-out duration, i.e. the time between when the volume starts falling and when it reaches 0.
Fade-in start offset For a crossfade, it specifies the time between the start of the fade-out and the start of the fade-in.
If a negative value is specified, the fade-in starts before the fade-out.
Delay after fade-out Specifies the time between when the volume has reached 0 and when the playback is actually stopped.]
This parameter must be set when there is a delay due to the specifications of sound drivers and hardware.
criatomex_fader_glaph.png