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) => {