From 2502cc5bf017ed65949305a3f4d6bc3cbeeaa972 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:46 -0300 Subject: [PATCH] fix: play right samples in right channel --- src/apu.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apu.zig b/src/apu.zig index fd3b2ea..d8ca896 100644 --- a/src/apu.zig +++ b/src/apu.zig @@ -182,7 +182,7 @@ pub const Apu = struct { right += bias; const tmp_left = std.math.clamp(@intCast(u16, left), std.math.minInt(u11), std.math.maxInt(u11)); - const tmp_right = std.math.clamp(@intCast(u16, left), std.math.minInt(u11), std.math.maxInt(u11)); + const tmp_right = std.math.clamp(@intCast(u16, right), std.math.minInt(u11), std.math.maxInt(u11)); // Extend to 16-bit signed audio samples const final_left = (tmp_left << 5) | (tmp_left >> 6);