Skip to content

Commit 2ec802f

Browse files
We should multiply by channel count, not divide!
1 parent d8aaca2 commit 2ec802f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

audio/src/player.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ impl Player {
160160
ebu_r128 = Some(EbuR128::new(channels as u32, rate, Mode::I)?);
161161
} else {
162162
if let Some(fade_duration) = self.fade_duration {
163-
// Calculate the Change in Volume per sample..
164-
fade_amount = Some(1.0 / (rate as f32 * fade_duration) / channels as f32);
163+
// Calculate the Change in Volume per sample
164+
fade_amount = Some(1.0 / (rate as f32 * fade_duration) * channels as f32);
165165
}
166166

167167
if let Some(frames) = frames {

0 commit comments

Comments
 (0)