From 1505da074ca6ead91396ecb4f925f0ae137a120c Mon Sep 17 00:00:00 2001 From: Markus Vogelbacher Date: Tue, 26 Mar 2024 09:29:54 +0100 Subject: [PATCH] Fix computation of spectrogram segments --- front/src/hooks/spectrogram/useRecordingSegments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/hooks/spectrogram/useRecordingSegments.ts b/front/src/hooks/spectrogram/useRecordingSegments.ts index 0a495ca6..bb37409f 100644 --- a/front/src/hooks/spectrogram/useRecordingSegments.ts +++ b/front/src/hooks/spectrogram/useRecordingSegments.ts @@ -104,7 +104,7 @@ function getSegments( } const hop = duration * (1 - overlap); - const numSegments = Math.ceil((fullDuration - hop) / hop); + const numSegments = Math.ceil((fullDuration - (duration - hop)) / hop); return Array(numSegments) .fill(0) .map((_, index: number) => {