Introduce a resampler (not used yet)

This commit is contained in:
Chris Cannam
2022-05-24 17:49:50 +01:00
parent 9ed4be5144
commit eb79336e93
2 changed files with 14 additions and 0 deletions

View File

@@ -172,6 +172,9 @@ public:
protected:
Impl *d;
int m_method;
Resampler(const Resampler &) =delete;
Resampler &operator=(const Resampler &) =delete;
};
}

View File

@@ -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<Resampler>
(new Resampler(resamplerParameters, m_parameters.channels));
calculateHop();
}
@@ -217,6 +227,7 @@ protected:
ChannelAssembly m_channelAssembly;
Peak<double, std::less<double>> m_troughPicker;
std::unique_ptr<StretchCalculator> m_calculator;
std::unique_ptr<Resampler> m_resampler;
int m_inhop;
int m_prevOuthop;
bool m_draining;