summaryrefslogtreecommitdiffstats
path: root/drivers/xaudio2/audio_driver_xaudio2.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2023-06-08 19:46:05 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2023-08-17 14:45:17 +0200
commit6f1152bdbe1338998b41c51c5a39dc6dac28ae31 (patch)
tree10ae7ca78b0da733070802d1108f28ca3c2c21d4 /drivers/xaudio2/audio_driver_xaudio2.cpp
parent281b7b9fdf033f391e6a2c2b1d777e61737ccb16 (diff)
downloadredot-engine-6f1152bdbe1338998b41c51c5a39dc6dac28ae31.tar.gz
Add a `--audio-output-latency` command-line argument
This allows optimizing the audio output latency on higher-end CPUs, especially in projects that do not expose a way to override this setting.
Diffstat (limited to 'drivers/xaudio2/audio_driver_xaudio2.cpp')
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp
index 22063c52d9..3fe3ea058b 100644
--- a/drivers/xaudio2/audio_driver_xaudio2.cpp
+++ b/drivers/xaudio2/audio_driver_xaudio2.cpp
@@ -45,7 +45,7 @@ Error AudioDriverXAudio2::init() {
speaker_mode = SPEAKER_MODE_STEREO;
channels = 2;
- int latency = GLOBAL_GET("audio/driver/output_latency");
+ int latency = Engine::get_singleton()->get_audio_output_latency();
buffer_size = closest_power_of_2(latency * mix_rate / 1000);
samples_in = memnew_arr(int32_t, buffer_size * channels);