Use stft.finishOutput() in stretch.flush() to avoid errors

This commit is contained in:
Geraint 2025-02-08 11:52:32 +00:00 committed by Geraint Luff
parent eaa9883ff1
commit 7238c4c5a4
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -260,6 +260,7 @@ struct SignalsmithStretch {
void flush(Outputs &&outputs, int outputSamples) {
int plainOutput = std::min<int>(outputSamples, stft.blockSamples());
int foldedBackOutput = std::min<int>(outputSamples, int(stft.blockSamples()) - plainOutput);
stft.finishOutput(1);
for (int c = 0; c < channels; ++c) {
tmpBuffer.resize(plainOutput);
stft.readOutput(c, plainOutput, tmpBuffer.data());