mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
Reject sample rates that are out-of-range for libsoundtouch.
We never reach this with our normal use of this lib but adding the sanity check just in case. (ported from upstream)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user