From 6a793097226eb4ad0c2ad856c0cfe343b1adf7c2 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 9 Nov 2024 23:52:29 +0200 Subject: [PATCH] HLE DSP: Fix up resampling a bit --- src/core/audio/hle_core.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/audio/hle_core.cpp b/src/core/audio/hle_core.cpp index 96e51aae..77ed719f 100644 --- a/src/core/audio/hle_core.cpp +++ b/src/core/audio/hle_core.cpp @@ -487,10 +487,10 @@ namespace Audio { decodeBuffer(source); } else { - uint maxSampleCount = uint(float(Audio::samplesInFrame) * 1.0); usize outputCount = 0; + static constexpr usize maxSamples = Audio::samplesInFrame; - while (outputCount < maxSampleCount) { + while (outputCount < maxSamples) { if (source.currentSamples.empty()) { if (source.buffers.empty()) { break; @@ -518,9 +518,9 @@ namespace Audio { ); break; } - - source.samplePosition += u32(outputCount); } + + source.samplePosition += u32(outputCount * source.rateMultiplier); } }