From 6aeb71392138ab8e8098aedd96d6e395094fbda9 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Wed, 12 May 2021 17:29:26 +0100 Subject: [PATCH] Use proper parameters for processing mode --- src/StretcherImpl.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/StretcherImpl.cpp b/src/StretcherImpl.cpp index a955299..ca5b52a 100644 --- a/src/StretcherImpl.cpp +++ b/src/StretcherImpl.cpp @@ -674,8 +674,16 @@ RubberBandStretcher::Impl::configure() Resampler::Parameters params; params.quality = Resampler::FastestTolerable; - params.dynamism = Resampler::RatioMostlyFixed; - params.ratioChange = Resampler::SmoothRatioChange; + + if (m_realtime) { + params.dynamism = Resampler::RatioOftenChanging; + params.ratioChange = Resampler::SmoothRatioChange; + } else { + // ratio can't be changed in offline mode + params.dynamism = Resampler::RatioMostlyFixed; + params.ratioChange = Resampler::SuddenRatioChange; + } + params.maxBufferSize = 4096 * 16; params.debugLevel = m_debugLevel; @@ -820,7 +828,7 @@ RubberBandStretcher::Impl::reconfigure() Resampler::Parameters params; params.quality = Resampler::FastestTolerable; - params.dynamism = Resampler::RatioMostlyFixed; + params.dynamism = Resampler::RatioOftenChanging; params.ratioChange = Resampler::SmoothRatioChange; params.maxBufferSize = m_sWindowSize; params.debugLevel = m_debugLevel;