aboutsummaryrefslogtreecommitdiff
path: root/options.h
diff options
context:
space:
mode:
authorneonloop2022-03-27 16:33:44 +0000
committerneonloop2022-03-27 16:33:44 +0000
commit8870de89ba1ad9ae08e5f4c7602007b05fab5f3e (patch)
tree21447aa0ef726eb04317cdd9f0d9481fcb69f297 /options.h
parentcaa956d120b34e4c0deadb9e61af509a88debd09 (diff)
downloadpicoarch-8870de89ba1ad9ae08e5f4c7602007b05fab5f3e.tar.gz
picoarch-8870de89ba1ad9ae08e5f4c7602007b05fab5f3e.tar.bz2
picoarch-8870de89ba1ad9ae08e5f4c7602007b05fab5f3e.zip
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
Diffstat (limited to 'options.h')
-rw-r--r--options.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/options.h b/options.h
index 268a619..c76e251 100644
--- a/options.h
+++ b/options.h
@@ -8,6 +8,7 @@ extern int show_cpu;
extern int show_hud;
extern int limit_frames;
extern int enable_audio;
+extern int enable_drc;
extern unsigned audio_buffer_size;
extern enum scale_size scale_size;
extern enum scale_filter scale_filter;