mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09: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:
parent
13aff00f59
commit
e82bb23d7e
2 changed files with 8 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue