From f59f5dfaa388b268091539194f68310e69c03801 Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:08:17 -0600 Subject: [PATCH] Fixed ms_duration function to show actual ms (#1836) --- firmware/common/utility.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/common/utility.hpp b/firmware/common/utility.hpp index 924297f6..9eab69e6 100644 --- a/firmware/common/utility.hpp +++ b/firmware/common/utility.hpp @@ -111,7 +111,7 @@ inline uint32_t ms_duration( if (sample_rate == 0 || bytes_per_sample == 0) return 0; - return buffer_size / bytes_per_sample / sample_rate * 1000; + return buffer_size * 1000 / (bytes_per_sample * sample_rate); } int fast_int_magnitude(int y, int x);