Add resample-before mode

This commit is contained in:
Chris Cannam
2022-09-02 14:49:34 +01:00
parent deb84a5f78
commit 021de9d51c
3 changed files with 107 additions and 31 deletions

View File

@@ -398,6 +398,29 @@ protected:
RubberBandStretcher::OptionProcessRealTime;
}
void areWeResampling(bool *before, bool *after) const {
if (before) *before = false;
if (after) *after = false;
if (!m_resampler) return;
if (m_parameters.options &
RubberBandStretcher::OptionPitchHighConsistency) {
if (after) *after = true;
} else if (m_pitchScale != 1.0) {
if (m_pitchScale > 1.0 &&
(m_parameters.options &
RubberBandStretcher::OptionPitchHighQuality)) {
if (after) *after = true;
} else if (m_pitchScale < 1.0) {
if (after) *after = true;
} else {
if (before) *before = true;
}
}
}
bool isSingleWindowed() const {
return m_parameters.options &
RubberBandStretcher::OptionWindowShort;