Bug 995289 - Use fmod to wrap custom waveform phase. r=padenot

From 4156df84046e8c0be31f02a9ac0ffac1cb9fe668 Mon Sep 17 00:00:00 2001
This commit is contained in:
Ralph Giles 2014-04-14 19:12:13 -07:00
parent 9243138b13
commit a82d7f8191

View File

@ -386,9 +386,7 @@ public:
tableInterpolationFactor);
// mPhase runs 0..periodicWaveSize here instead of 0..2*M_PI.
mPhase += periodicWaveSize * mFinalFrequency * rate;
if (mPhase >= periodicWaveSize) {
mPhase -= periodicWaveSize;
}
mPhase = fmod(mPhase, periodicWaveSize);
// Bilinear interpolation between adjacent samples in each table.
uint32_t j1 = floor(mPhase);
uint32_t j2 = j1 + 1;