Version
menu_open

Managing crossfades

Blend Containers allow multiple objects to be played at once. Enabling crossfading in a blend track changes how these objects are heard or felt. To help you manage crossfading, each object in a blend track is displayed as a block. These blocks are charted on a graph with an X axis representing a changing Game Parameter. The position of these blocks on the X axis indicates the Game Parameter values at which the sounds will be heard or the motion effects will be felt.

When you overlap blocks to create crossfades, you smooth the transition between objects and increase realism in your game. Crossfading can also be combined with RTPC curves in the blend tracks of Blend Containers to alter the properties of objects.

Using crossfades - example

For example, let's say your game is a roller-coaster simulator. Your player can build coasters with speeds that vary from 0 to 200 km/h. On a basic level, you can use a Blend Container to assign an RTPC to the sounds of the roller coaster riders, increasing their volume as the coaster speed increases. But let's say you've collected many different sounds to represent the riders, ranging from bored grumbling to excited cheering to terrified screams. If you use a Blend Container to hold these sounds, these different sounds can be heard selectively depending on what speed the coaster is going. When the coaster speed increases to 40 km/h, for example, your excited cheering sounds could begin to be heard. Your player will hear the different rider sounds, as well as an increase in volume for each sound.

Using crossfading

To use crossfades in a Blend Container, you first need to enable them. Then, you can adjust the size of your blocks. When the Game Parameter reaches the point where the block meets the X axis, the object is heard. When you overlap these blocks, you create a crossfade.

Crossfades help organize the playback of objects within a Blend Container. Because all the objects in a Blend Container play at once and are heard or felt based on RTPC mappings, using crossfades creates room for smoother transitions between objects. For example, if you created an RTPC to represent the passage of time in your game, you could overlap crossfades for cricket sounds and bird sounds to represent dawn.

To use crossfading:

  1. In the Blend Track Editor, select the blend track to which you want to add crossfading.

    The blend track becomes active.

  2. Select the Crossfading option.

    The Game Parameter list becomes available.

  3. Select the Game Parameter on which you want to base crossfading in this blend track.

    Blocks are displayed for the objects in the blend track, with the X axis representing the Game Parameter.

    Each object in the blend track is represented as a colored block in the graph. The blocks are drawn in the same order as the objects are listed in the blend tracks column of the contents editor.

  4. Adjust block sizes and positions by selecting a block and dragging its edges left or right.

    The objects corresponding to the blocks are played as indicated by the X axis.

Using crossfading with RTPCs

Blend tracks allow you to combine the power of RTPC curves with the flexibility of crossfades. Within a Blend Container, you can determine the crossfading between objects based on a Game Parameter, and then apply RTPC curves to these same objects.

Keep in mind that you can base crossfades and RTPC curves in a blend track on different parameters. For example, in a roller-coaster simulator, you could have an RTPC curve that increases the pitch of your rider noises as the car angle becomes steeper. However, you could add cross-fading to that blend track based on speed to change which sounds are heard based on speed. Therefore, the sounds that are heard shift as the ride gets faster, and all these sounds become higher pitched as the ride gets steeper.

Setting crossfade modes

Wwise can handle crossfading in various ways, all depending on your preferences. You can use the following three modes to adjust the crossfading between the objects in your blend tracks:

  • None: The property of the RTPC transitions from its maximum to its minimum value or vice versa instantly when crossing the overlapping block's boundaries.

  • Automatic (default): The fading range depends on the width of the overlap with the neighboring block. If there is no neighboring block, there is no fade.

  • Manual: You can move the point where the fade-in ends or the fade-out begins. The beginning of a fade-in or end of a fade-out will always begin at the outside lower corner of the overlapping block.

[Note]Note

You can also modify the shape of the crossfade curves. For information on setting curve shapes, refer to Specifying the shape of the curve between control points.

To select a crossfade mode:

  1. Right-click the edge of a block and click a mode.

Using caution with crossfade transitions

The following listed points provide some additional information that you must be aware of before using the crossfade transition within a Random or Sequence Container.

  • Audio File Length

    • Audio file length must be greater than or equal to 0.2 seconds.

    • The minimum crossfade time is 0.1 seconds.

  • Crossfade Time in Relation to Audio File Length

    • When cross-fading from Sound A to Sound B, the maximum crossfade time allowed by the sound engine is half the length of audio file A. In cases where the crossfade time is longer than the maximum allowed, the crossfade time will automatically be adjusted to half the length of the out-going audio file.

      [Note]Note

      Wwise does not limit or indicate that the crossfade is too long for one or more audio files in the container. If an adjustment to the crossfade time is required, it will be done by the sound engine at runtime.

  • Pause and Crossfades

    • If you pause sounds that are using crossfade transitions and also apply a fade-out to the pause application, the timing of the crossfade might be inaccurate.

  • Pitch and Crossfades

    • If you use an RTPC to set the pitch value for a container or a Set Pitch Event Action is triggered while a container is playing, you might experience unexpected results when the crossfade is applied between sounds.

  • Source Plug-ins and Crossfades

    • If you apply a crossfade to a source plug-in, the crossfade might be ignored if the end of the source cannot be determined. This can happen, for example, when the duration of a sine generated source is based on an RTPC. In these types of cases, the crossfade is ignored and the transition is done without the crossfade.

  • Switch Containers and Crossfades

    • When a Switch Container is a child of a Sequence Container, crossfade transitions will be applied differently depending on the number of Wwise objects assigned to a Switch.

  • Two Voices

    • Two different voices are used by the sound engine during a crossfade.

  • Virtual Voices and Crossfades

    • By definition, Play from Beginning and Resume virtual voice behaviors have an effect on sound duration when it goes under the Volume Threshold or over the Playback Limit, which is not taken into account by the crossfade timing mechanism.

    • Voices might become virtual when their volume goes under the threshold. For any given sound, the volume that is compared against the threshold is the real effective volume of all its audio channels. This includes resulting from the contribution of all volumes of the Actor-Mixer Hierarchy, Fade transitions, Interactive-music transitions, RTPCs, States, positioning, and attenuations.

    • The contribution of fade transitions also counts when computing the effective volume of a sound. Consequently, during a crossfade transition inside a Random, Sequence, or Blend Container, fading sounds will likely go below the volume threshold for some time. If their behavior under threshold is Play from Beginning or Resume, their real duration will be longer than expected by the container's logic. This will result in unpredictable behavior. Worse, when a sound fades out under threshold, it stops "virtually" playing, and therefore never ends. The container could, consequently, stop sequencing more sounds.

    In sum, we recommend that you avoid using these types of virtual voices with containers that use crossfade transitions. If you do use virtual voices with these containers, we recommend that you select the Play from elapsed time behavior.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise