Skip to content

Commit

Permalink
Properly mask left channel audio sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Grarak committed Feb 1, 2025
1 parent ea04a27 commit 28e7790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/spu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ impl Spu {
let spu = get_spu_mut!(emu);
unsafe {
assert_unchecked(spu.samples_buffer.len() < spu.samples_buffer.capacity());
spu.samples_buffer.push_within_capacity((sample_right << 16) | sample_left).unwrap_unchecked();
spu.samples_buffer.push_within_capacity((sample_right << 16) | (sample_left & 0xFFFF)).unwrap_unchecked();
}
if unlikely(spu.samples_buffer.len() == SAMPLE_BUFFER_SIZE) {
spu.sound_sampler.push(spu.samples_buffer.as_slice());
Expand Down

0 comments on commit 28e7790

Please sign in to comment.