From 7238c4c5a4abc2939483ec964207cf64c59ed575 Mon Sep 17 00:00:00 2001 From: Geraint Date: Sat, 8 Feb 2025 11:52:32 +0000 Subject: [PATCH] Use `stft.finishOutput()` in `stretch.flush()` to avoid errors --- CMakeLists.txt | 2 +- signalsmith-stretch.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5c7dde..1e8698c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ include(FetchContent) FetchContent_Declare( signalsmith-linear GIT_REPOSITORY https://github.com/Signalsmith-Audio/linear.git - GIT_TAG a0d287899adad259e3e29ac4831ffa0368f07092 + GIT_TAG 8b552cc24e334387c863033826769a4c6c89c1f2 GIT_SHALLOW ON ) FetchContent_MakeAvailable(signalsmith-linear) diff --git a/signalsmith-stretch.h b/signalsmith-stretch.h index 72a2318..35f2967 100644 --- a/signalsmith-stretch.h +++ b/signalsmith-stretch.h @@ -260,6 +260,7 @@ struct SignalsmithStretch { void flush(Outputs &&outputs, int outputSamples) { int plainOutput = std::min(outputSamples, stft.blockSamples()); int foldedBackOutput = std::min(outputSamples, int(stft.blockSamples()) - plainOutput); + stft.finishOutput(1); for (int c = 0; c < channels; ++c) { tmpBuffer.resize(plainOutput); stft.readOutput(c, plainOutput, tmpBuffer.data());