From a35bdadc52121946a7069608e1f7f35322eb08e8 Mon Sep 17 00:00:00 2001 From: vanfanel Date: Wed, 5 Apr 2023 13:41:08 +0200 Subject: [PATCH] Fix wrong audio samplerate when using framerates other than 60FPS. --- libretro/libretro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 5c11b67..9c55f3d 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -421,7 +421,8 @@ void retro_get_system_av_info(struct retro_system_av_info *info) info->timing.fps = TICRATE; break; } - info->timing.sample_rate = 44100.0; + float rate_factor = info->timing.fps / 60.0; + info->timing.sample_rate = 44100.0 * rate_factor; info->geometry.base_width = SCREENWIDTH; info->geometry.base_height = SCREENHEIGHT; info->geometry.max_width = SCREENWIDTH;