Sound Effects

As of now, USound only supports audio fading effects. Fading uses the Animatables system. In each example, we will use the fading effects on the default background music sound source.

Fading In

float length = 1f;
USoundManager.defaultBGMSource.FadeIn(length);

Fading Out

float length = 1f;
USoundManager.defaultBGMSource.FadeOut(length);

Crossfading Audio Clips

Ensure the sound source is already playing an audio clip before trying to crossfade.

AudioClip newClip = USoundManager.GetAudioClip("some song");
float length = 1f;
USoundManager.defaultBGMSource.Crossfade(newClip, length);

Last updated