File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,10 @@ class Mixer {
151151 inline static public function updateSmoothMusicTime (deltaTime : Float , playfield : PlayField , window : Window ): Void {
152152 if (isPlaying ()) {
153153 var ogSongPos = playfield .songPosition + (deltaTime * speed );
154- var rawPlaybackPosition = MiniAudio .getPlaybackPosition () + (playfield .latencyCompensation - Mixer .latency ());
155- if (rawPlaybackPosition < 40 ) {
156- playfield .songPosition = ogSongPos ;
154+ var latency = playfield .latencyCompensation - Mixer .latency ();
155+ var rawPlaybackPosition = MiniAudio .getPlaybackPosition () + latency ;
156+ if (playfield .songPosition - rawPlaybackPosition > 10 ) {
157+ playfield .songPosition = ogSongPos + latency ;
157158 } else {
158159 playfield .songPosition + = deltaTime * speed ;
159160
You can’t perform that action at this time.
0 commit comments