From 190e8bc677d67e94dd27638aa6cac216d6e6214a Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sat, 2 Jan 2021 18:09:39 -0800 Subject: [PATCH] Fixed bug in decibels code, was too loud --- examples/blits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/blits.rs b/examples/blits.rs index 5089ecc..817e25a 100644 --- a/examples/blits.rs +++ b/examples/blits.rs @@ -34,7 +34,7 @@ fn dbfs_to_f32(dbfs : f32) -> f32 { } fn dbfs_to_signed_int(dbfs: f32, bit_depth: u16) -> i32 { - let full_code : i32 = (1i32 << (bit_depth + 1)) - 1; + let full_code : i32 = (1i32 << bit_depth - 1) - 1; ((full_code as f32) * dbfs_to_f32(dbfs)) as i32 }