From c6ce810afe15edea696b77c9433b1d453f9856a2 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 27 May 2022 18:47:15 -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);