From b2242b2e1c529c77fea2a5508ec4200524d22c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com> Date: Tue, 28 Feb 2023 00:37:36 +0000 Subject: [PATCH] feat: new default variables for sound delay --- frontends/web/ts/gb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/web/ts/gb.ts b/frontends/web/ts/gb.ts index 277ab156..da83b95c 100644 --- a/frontends/web/ts/gb.ts +++ b/frontends/web/ts/gb.ts @@ -346,7 +346,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { // some sync, this is required because of time hogging const audioCurrentTime = this.audioContext.currentTime; if ( - this.nextPlayTime > audioCurrentTime + 0.05 || + this.nextPlayTime > audioCurrentTime + 0.25 || this.nextPlayTime < audioCurrentTime ) { // @TODO: this is tricky as it cancels most of the code @@ -355,7 +355,7 @@ export class GameboyEmulator extends EmulatorBase implements Emulator { chunk.source.stop(); }); this.audioChunks = []; - this.nextPlayTime = audioCurrentTime; + this.nextPlayTime = audioCurrentTime + 0.1; } const source = this.audioContext.createBufferSource(); -- GitLab