Reject sample rates that are out-of-range for libsoundtouch.
This commit is contained in:
parent
93f487041c
commit
2b9905b1ba
|
@ -283,9 +283,9 @@ void SoundTouch::calcEffectiveRateAndTempo()
|
|||
// Sets sample rate.
|
||||
void SoundTouch::setSampleRate(uint srate)
|
||||
{
|
||||
bSrateSet = true;
|
||||
// set sample rate, leave other tempo changer parameters as they are.
|
||||
pTDStretch->setParameters((int)srate);
|
||||
bSrateSet = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -126,8 +126,13 @@ void TDStretch::setParameters(int aSampleRate, int aSequenceMS,
|
|||
int aSeekWindowMS, int aOverlapMS)
|
||||
{
|
||||
// accept only positive parameter values - if zero or negative, use old values instead
|
||||
if (aSampleRate > 0) this->sampleRate = aSampleRate;
|
||||
if (aOverlapMS > 0) this->overlapMs = aOverlapMS;
|
||||
if (aSampleRate > 0)
|
||||
{
|
||||
if (aSampleRate > 192000) ST_THROW_RT_ERROR("Error: Excessive samplerate");
|
||||
this->sampleRate = aSampleRate;
|
||||
}
|
||||
|
||||
if (aOverlapMS > 0) this->overlapMs = aOverlapMS;
|
||||
|
||||
if (aSequenceMS > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue