From 37e46358ea220c3f8ba4ab0b7d4a5769f8ae3c3b Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Sun, 30 Jun 2024 17:33:08 +0100 Subject: [PATCH] Fixed realtime audio not working correctly at emulation speeds over 100% --- src/audio_core/hle/hle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/audio_core/hle/hle.cpp b/src/audio_core/hle/hle.cpp index 3687f9647..56ca69749 100644 --- a/src/audio_core/hle/hle.cpp +++ b/src/audio_core/hle/hle.cpp @@ -419,7 +419,8 @@ void DspHle::Impl::AudioTickCallback(s64 cycles_late) { // Reschedule recurrent event const double time_scale = Settings::values.enable_realtime_audio - ? std::clamp(Core::System::GetInstance().GetStableFrameTimeScale(), 1.0, 3.0) + ? std::clamp(Core::System::GetInstance().GetStableFrameTimeScale(), + 100. / Settings::values.frame_limit.GetValue(), 3.0) : 1.0; s64 adjusted_ticks = static_cast(audio_frame_ticks / time_scale - cycles_late); core_timing.ScheduleEvent(adjusted_ticks, tick_event);