From 55b6b1714051bc3a7f92e42c0d1a38fa1950f1c2 Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Thu, 23 Apr 2020 20:08:18 +0800 Subject: [PATCH] native,devices,audio: modify the buffer size to match the one in fceux * this fixed the delay --- am/src/native/devices/audio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/am/src/native/devices/audio.c b/am/src/native/devices/audio.c index 2cbcec91..edd8c475 100644 --- a/am/src/native/devices/audio.c +++ b/am/src/native/devices/audio.c @@ -3,7 +3,7 @@ #include #include -#define SBUF_SIZE 65536 +#define SBUF_SIZE 22576 //65536 static uint8_t sbuf [SBUF_SIZE] = {}; static int head = 0, tail = 0; static volatile int count = 0; @@ -52,8 +52,7 @@ void __am_audio_init() { s.samples = 512; s.callback = audio_play; s.userdata = NULL; - - SDL_OpenAudio(&s, 0); + SDL_OpenAudio(&s, NULL); SDL_PauseAudio(0); } -- GitLab