🔊
USound
  • đŸ•šī¸Getting Started
    • Introducing USound
    • Installation
    • Components
  • 📄Scripting Basics
    • Managing Sound Sources
    • Playing Sound
    • Sound Effects
  • đŸ› ī¸Support
    • Getting Help
    • Contact
  • 📚Changelogs
    • Latest Releases
Powered by GitBook
On this page
  • Fading In
  • Fading Out
  • Crossfading Audio Clips
  1. Scripting Basics

Sound Effects

PreviousPlaying SoundNextGetting Help

Last updated 11 months ago

As of now, USound only supports audio fading effects. Fading uses the 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);
📄
Animatables