We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8452a09 commit a02cff9Copy full SHA for a02cff9
filter-test/src/main.rs
@@ -171,10 +171,10 @@ fn process_audio_file(
171
let samples_per_channel = mono_samples.len() / channels.count();
172
let mut downmixed = Vec::with_capacity(samples_per_channel);
173
174
- for i in 0..samples_per_channel {
+ for i in (0..mono_samples.len()).step_by(channels.count()) {
175
let mut sum = 0i32;
176
for ch in 0..channels.count() {
177
- sum += mono_samples[i + ch * samples_per_channel] as i32;
+ sum += mono_samples[i + ch] as i32;
178
}
179
downmixed.push((sum / channels.count() as i32) as i16);
180
0 commit comments