diff --git a/src/common/Resampler.h b/src/common/Resampler.h index 142ce58..6080e0f 100644 --- a/src/common/Resampler.h +++ b/src/common/Resampler.h @@ -172,6 +172,9 @@ public: protected: Impl *d; int m_method; + + Resampler(const Resampler &) =delete; + Resampler &operator=(const Resampler &) =delete; }; } diff --git a/src/finer/R3StretcherImpl.h b/src/finer/R3StretcherImpl.h index 45ddd85..699a996 100644 --- a/src/finer/R3StretcherImpl.h +++ b/src/finer/R3StretcherImpl.h @@ -30,6 +30,7 @@ #include "PhaseAdvance.h" #include "../common/StretchCalculator.h" +#include "../common/Resampler.h" #include "../common/FFT.h" #include "../common/FixedVector.h" #include "../common/Allocators.h" @@ -102,6 +103,15 @@ public: (new StretchCalculator(int(round(m_parameters.sampleRate)), //!!! which is a double... 1, false)); // no fixed inputIncrement + Resampler::Parameters resamplerParameters; + resamplerParameters.quality = Resampler::FastestTolerable; + resamplerParameters.dynamism = Resampler::RatioOftenChanging; + resamplerParameters.ratioChange = Resampler::SmoothRatioChange; + resamplerParameters.initialSampleRate = m_parameters.sampleRate; + resamplerParameters.maxBufferSize = m_guideConfiguration.longestFftSize; //!!!??? + m_resampler = std::unique_ptr + (new Resampler(resamplerParameters, m_parameters.channels)); + calculateHop(); } @@ -217,6 +227,7 @@ protected: ChannelAssembly m_channelAssembly; Peak> m_troughPicker; std::unique_ptr m_calculator; + std::unique_ptr m_resampler; int m_inhop; int m_prevOuthop; bool m_draining;