From ba0450e9990584d6b184ad8b6953b537b408ffcd Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 1 Jun 2026 23:27:46 -0400 Subject: [PATCH] fix: coerce `sample_rate` to `u64` correctly --- 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 84e9779..52181fe 100644 --- a/src/command/render.rs +++ b/src/command/render.rs @@ -294,7 +294,7 @@ pub async fn handle(state: State, interaction: Interaction) { let channels = state.audio_channels.into(); let sample_rate = state.audio_sample_rate.into(); - let total_samples = (duration.whole_seconds() as u64 * sample_rate) + let total_samples = (duration.whole_seconds() as u64 * sample_rate as u64) + (duration.subsec_microseconds() as u64 * sample_rate as u64 / 1_000_000); let mut composite = vec![0; total_samples as usize]; @@ -342,7 +342,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) + let origin = (after_start.whole_seconds() as u64 * sample_rate as u64) + (after_start.subsec_microseconds() as u64 * sample_rate as u64 / 1_000_000); let origin = origin as usize;