mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
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:
parent
9243138b13
commit
a82d7f8191
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user