From 66be960150418f6758d4ea86f67eb037eece4f9f Mon Sep 17 00:00:00 2001
From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
Date: Tue, 19 Nov 2024 01:27:42 +0200
Subject: [PATCH] HLE DSP: Stub audio output

---
 src/core/audio/hle_core.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/core/audio/hle_core.cpp b/src/core/audio/hle_core.cpp
index 1e7b6bfb..3ab05c93 100644
--- a/src/core/audio/hle_core.cpp
+++ b/src/core/audio/hle_core.cpp
@@ -211,11 +211,11 @@ namespace Audio {
 
 		if (audioEnabled) {
 			// Wait until we've actually got room to push our frame
-			while (sampleBuffer.size() + 2 > sampleBuffer.Capacity()) {
+			while (sampleBuffer.size() + frame.size() * 2 > sampleBuffer.Capacity()) {
 				std::this_thread::sleep_for(std::chrono::milliseconds{1});
 			}
 
-			sampleBuffer.push(frame.data(), frame.size());
+			sampleBuffer.push(frame.data(), frame.size() * 2);
 		}
 	}
 
@@ -276,6 +276,12 @@ namespace Audio {
 			}
 		}
 
+		for (int i = 0; i < Audio::samplesInFrame; i++) {
+			auto& mix0 = mixes[0];
+			auto& sample = mix0[i];
+			frame[i] = {s16(sample[0]), s16(sample[2])};
+		}
+
 		performMix(read, write);
 	}