From 807bd7f05adc41672f47cb88d2dee65c12b5852b Mon Sep 17 00:00:00 2001 From: minenice55 Date: Thu, 12 Jan 2023 17:34:38 -0500 Subject: [PATCH] revert sound prescheduling behaviour (#195) --- Assets/Scripts/Util/Sound.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Scripts/Util/Sound.cs b/Assets/Scripts/Util/Sound.cs index d9bfd68a..1c4a2f97 100644 --- a/Assets/Scripts/Util/Sound.cs +++ b/Assets/Scripts/Util/Sound.cs @@ -52,7 +52,7 @@ namespace HeavenStudio.Util { playInstant = false; scheduledPitch = cnd.musicSource.pitch; - startTime = cnd.dspStartTimeAsDouble + ((cnd.GetSongPosFromBeat(beat - cnd.startBeatAsDouble))/(double)scheduledPitch); + startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch); audioSource.PlayScheduled(startTime); } }