From 1d8885131ef2b0bfb99b1f347717ba8f3f1da4c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 4 Aug 2025 14:36:02 +0900 Subject: [PATCH] Fade music back in when returning from song select from gameplay Addresses abrupt playback pointed out in https://github.com/ppy/osu/discussions/34472. In cases where the music is already playing, this isn't required (ie when returning from the player loading screen before gameplay starts). --- osu.Game/Screens/SelectV2/SongSelect.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index 5635fa07fc..0d77baa7f6 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -598,6 +598,18 @@ namespace osu.Game.Screens.SelectV2 if (ControlGlobalMusic) { + // Avoid abruptly starting playback at preview point. + if (!music.IsPlaying) + { + music.DuckMomentarily(0, new DuckParameters + { + DuckDuration = 0, + DuckVolumeTo = 0, + RestoreDuration = 800, + RestoreEasing = Easing.OutQuint + }); + } + // restart playback on returning to song select, regardless. // not sure this should be a permanent thing (we may want to leave a user pause paused even on returning) music.ResetTrackAdjustments();