Fix accidental time stretch coming along with pitch shift

This commit is contained in:
Chris Cannam
2022-05-27 15:03:40 +01:00
parent f13d96a474
commit 7febc09dbc

View File

@@ -315,16 +315,20 @@ R3StretcherImpl::retrieve(float *const *output, size_t samples) const
void void
R3StretcherImpl::consume() R3StretcherImpl::consume()
{ {
double ratio = getEffectiveRatio();
int inhop = m_inhop;
int longest = m_guideConfiguration.longestFftSize; int longest = m_guideConfiguration.longestFftSize;
int channels = m_parameters.channels; int channels = m_parameters.channels;
// m_calculator->setDebugLevel(3); // m_calculator->setDebugLevel(3);
int inhop = m_inhop;
double effectivePitchRatio = 1.0 / m_pitchScale;
if (m_resampler) {
effectivePitchRatio = m_resampler->getEffectiveRatio(effectivePitchRatio);
}
int outhop = m_calculator->calculateSingle(ratio, int outhop = m_calculator->calculateSingle(m_timeRatio,
1.0 / m_pitchScale, effectivePitchRatio,
1.f, 1.f,
inhop, inhop,
longest, longest,