Skip to content

Commit edb1322

Browse files
committed
fix garbage audio getting sent to surround sound channels
1 parent 35e6590 commit edb1322

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Fix `kira::spatial::scene::AddEmitterError` not being publicly available
44
- Fix some typos in the documentation
55
- Add the `assert_no_alloc` feature
6+
- Fix garbage audio getting sent to surround sound channels
67

78
# v0.8.4 - June 19, 2023
89

crates/kira/src/manager/backend/cpal/desktop/stream_manager.rs

+8
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ fn process_renderer(renderer_wrapper: &mut RendererWrapper, data: &mut [f32], ch
196196
} else {
197197
frame[0] = out.left;
198198
frame[1] = out.right;
199+
/*
200+
if there's more channels, send silence to them. if we don't,
201+
we might get bad sounds outputted to those channels.
202+
(https://github.com/tesselode/kira/issues/50)
203+
*/
204+
for channel in frame.iter_mut().skip(2) {
205+
*channel = 0.0;
206+
}
199207
}
200208
}
201209
}

0 commit comments

Comments
 (0)