From 8870de89ba1ad9ae08e5f4c7602007b05fab5f3e Mon Sep 17 00:00:00 2001 From: neonloop Date: Sun, 27 Mar 2022 16:33:44 +0000 Subject: Adds dynamic audio rate control option When DRC is on, game syncs to frame rate instead of audio buffer capacity. Audio is resampled to generate more samples when buffer is low and less when buffer is high, to keep buffer 40%-60% full. Buffer size doubled to keep same avg. audio latency value. Audio can distort when buffer is out of range, not often during gameplay. Better resampler could improve but would be slower. When buffer is always out of range (heavy frameskip), it is better to leave off, DRC doesn't help anyway then. Idea from RetroArch audio_driver.c and https://near.sh/articles/audio/dynamic-rate-control --- options.c | 1 + 1 file changed, 1 insertion(+) (limited to 'options.c') diff --git a/options.c b/options.c index 95b4c71..6cf27cd 100644 --- a/options.c +++ b/options.c @@ -11,6 +11,7 @@ int show_cpu; int show_hud; int limit_frames; int enable_audio; +int enable_drc; unsigned audio_buffer_size; enum scale_size scale_size; enum scale_filter scale_filter; -- cgit v1.2.3