From a7f11a720298be048191dcc10fe36a5e30ab0059 Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 1 Jun 2026 23:23:43 -0400 Subject: [PATCH] fix: cast `sample_rate` to `u64` in calculations --- src/command/render.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command/render.rs b/src/command/render.rs index 0b87fe2..84e9779 100644 --- a/src/command/render.rs +++ b/src/command/render.rs @@ -295,7 +295,7 @@ pub async fn handle(state: State, interaction: Interaction) { let sample_rate = state.audio_sample_rate.into(); let total_samples = (duration.whole_seconds() as u64 * sample_rate) - + (duration.subsec_microseconds() as u64 * sample_rate / 1_000_000); + + (duration.subsec_microseconds() as u64 * sample_rate as u64 / 1_000_000); let mut composite = vec![0; total_samples as usize]; @@ -343,7 +343,7 @@ pub async fn handle(state: State, interaction: Interaction) { let progress_by_time = after_start / duration; let origin = (after_start.whole_seconds() as u64 * sample_rate) - + (after_start.subsec_microseconds() as u64 * sample_rate / 1_000_000); + + (after_start.subsec_microseconds() as u64 * sample_rate as u64 / 1_000_000); let origin = origin as usize; let progress_by_sample = (origin as f64) / (total_samples as f64);