public void PlayCrossFade(string musicName, TimeSpan duration, bool loopTrack = true) { if (!IsPlaying) { Play(musicName, loopTrack); } else { CurrentMusic.FadeOut(duration); CurrentMusicName = musicName; CurrentMusic.Stop(); CurrentMusic.PlayFadeIn(Volume, duration, loopTrack); } }
public void FadeOut(TimeSpan duration) => CurrentMusic?.FadeOut(duration);