Skip to content

AudioService.StopMusic(float) Method

Definition

Namespace: Brine2D.Audio

Stops the currently playing music. When fadeDuration is greater than zero the music fades out over that many seconds; call Update(float) each frame to advance the fade.

public void StopMusic(float fadeDuration=0f);

Parameters

fadeDuration System.Single

Fade-out duration in seconds. Zero or negative means immediate stop.

Implements StopMusic(float)

Remarks

The fade shares internal state with CrossfadeMusic(IMusic, float, int, long, string). Starting a crossfade or calling PlayMusic(IMusic, int, long, string) while a fade-out is in progress will cancel the fade immediately.