Fix time-stretching bug (never recomputed previous block)

This commit is contained in:
Geraint 2025-02-05 23:15:12 +00:00
parent 94553a3789
commit d34b33da28

View File

@ -192,7 +192,7 @@ struct SignalsmithStretch {
bool newSpectrum = didSeek || (inputInterval > 0); bool newSpectrum = didSeek || (inputInterval > 0);
if (newSpectrum) { if (newSpectrum) {
if (didSeek || inputInterval != int(stft.samplesSinceAnalysis())) { // make sure the previous input is the correct distance in the past if (didSeek || inputInterval != int(stft.defaultInterval())) { // make sure the previous input is the correct distance in the past
stft.analyse(stft.defaultInterval()); stft.analyse(stft.defaultInterval());
// Copy previous analysis to our band objects // Copy previous analysis to our band objects
for (int c = 0; c < channels; ++c) { for (int c = 0; c < channels; ++c) {