From e9bd5a52ac95bcd9b4c8450e8f3f26ad2a7a01d0 Mon Sep 17 00:00:00 2001 From: HEIHUAa <112499486+HEIHUAa@users.noreply.github.com> Date: Sat, 22 Nov 2025 07:55:15 +0800 Subject: [PATCH] Improve Accurate VocalsResync (#833) * Improve Accurate VocalsResync * Update PlayState.hx --- source/funkin/game/PlayState.hx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 17c55c04..0282a465 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1255,12 +1255,13 @@ class PlayState extends MusicBeatState } @:dox(hide) - function resyncVocals():Void + inline function resyncVocals():Void { - var time = Conductor.songPosition + Conductor.songOffset; - for (strumLine in strumLines.members) strumLine.vocals.play(true, time); - vocals.play(true, time); + final time = Conductor.songPosition + Conductor.songOffset; + if (!inst.playing) inst.play(true, time); + vocals.play(true, time); + for (strumLine in strumLines.members) strumLine.vocals.play(true, time); gameAndCharsCall("onVocalsResync"); } @@ -1419,13 +1420,12 @@ class PlayState extends MusicBeatState else if (FlxG.sound.music != null && (__vocalSyncTimer -= elapsed) < 0) { __vocalSyncTimer = 1; - var instTime = FlxG.sound.music.getActualTime(); - var isOffsync:Bool = vocals.loaded && Math.abs(instTime - vocals.getActualTime()) > 100; - if (!isOffsync) { - for (strumLine in strumLines.members) { - if ((isOffsync = strumLine.vocals.loaded && Math.abs(instTime - strumLine.vocals.getActualTime()) > 100)) break; - } - } + final instTime = FlxG.sound.music.getActualTime(); + var isOffsync:Bool = vocals.loaded && Math.abs(instTime - vocals.getActualTime()) > 6; + if (!isOffsync) + for (strumLine in strumLines.members) + if ((isOffsync = strumLine.vocals.loaded && Math.abs(instTime - strumLine.vocals.getActualTime()) > 6)) + break; if (isOffsync) resyncVocals(); }