From 66b6ec703205017b828ee517ef03cf8023b2afb1 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Sun, 22 Sep 2024 14:48:28 +0200 Subject: [PATCH] fix CI --- Cargo.toml | 8 ++++---- src/util.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a210510..f2cf684 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,13 +53,13 @@ required-features = ["recording"] [dependencies] # +++ NOSTD DEPENDENCIES +++ - -biquad = "0.4" # lowpass filter +biquad = { version = "0.4", default-features = false } # lowpass filter +libm = { version = "0.2.8", default-features = false } log = { version = "0.4", default-features = false } -ringbuffer = "0.15.0" +ringbuffer = { version = "0.15.0", default-features = false } # +++ STD DEPENDENCIES +++ -cpal = { version = "0.15", optional = true } +cpal = { version = "0.15", default-features = false, features = [], optional = true } [dev-dependencies] diff --git a/src/util.rs b/src/util.rs index 6464886..f4b43f4 100644 --- a/src/util.rs +++ b/src/util.rs @@ -19,7 +19,7 @@ pub struct OutOfRangeError(f32); /// range `-i16::MAX..=i16::MAX`. #[inline] pub fn f32_sample_to_i16(val: f32) -> Result { - if val.is_finite() && val.abs() <= 1.0 { + if val.is_finite() && libm::fabsf(val) <= 1.0 { Ok((val * i16::MAX as f32) as i16) } else { Err(OutOfRangeError(val))