Skip to content

Commit 967bd4c

Browse files
committed
An attempt to fix stutters for low-end computers
1 parent 3074107 commit 967bd4c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/funkin/game/PlayState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ class PlayState extends MusicBeatState
552552
@:noCompletion @:dox(hide) private var _endSongCalled:Bool = false;
553553

554554
@:dox(hide)
555-
var __vocalSyncTimer:Float = 0;
555+
var __vocalSyncTimer:Float = 1;
556556

557557
private function get_accuracy():Float {
558558
if (accuracyPressedNotes <= 0) return -1;
@@ -1385,10 +1385,10 @@ class PlayState extends MusicBeatState
13851385
__vocalSyncTimer = 1;
13861386

13871387
var instTime = FlxG.sound.music.getActualTime();
1388-
var isOffsync:Bool = vocals.loaded && Math.abs(instTime - vocals.getActualTime()) > 30;
1388+
var isOffsync:Bool = vocals.loaded && Math.abs(instTime - vocals.getActualTime()) > 100;
13891389
if (!isOffsync) {
13901390
for (strumLine in strumLines.members) {
1391-
if ((isOffsync = strumLine.vocals.loaded && Math.abs(instTime - strumLine.vocals.getActualTime()) > 30)) break;
1391+
if ((isOffsync = strumLine.vocals.loaded && Math.abs(instTime - strumLine.vocals.getActualTime()) > 100)) break;
13921392
}
13931393
}
13941394

source/lime/_internal/backend/native/NativeAudioSource.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import lime.utils.ArrayBufferView;
2525
@:access(lime.media.AudioBuffer)
2626
@:access(lime.utils.ArrayBufferView)
2727
class NativeAudioSource {
28-
private static var STREAM_BUFFER_SAMPLES:Int = 0x1000;
29-
private static var STREAM_MAX_BUFFERS:Int = 32;
28+
private static var STREAM_BUFFER_SAMPLES:Int = 0x4000;
29+
private static var STREAM_MAX_BUFFERS:Int = 8;
3030
private static var STREAM_TIMER_FREQUENCY:Int = 100;
31-
private static var STREAM_BUFFER_FREQUENCY:Int = 6;
31+
private static var STREAM_BUFFER_FREQUENCY:Int = 3;
3232

3333
private var parent:AudioSource;
3434
private var disposed:Bool;

0 commit comments

Comments
 (0)