summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-18 07:12:50 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-18 07:12:50 +0000
commite51f2cda3cc65a26609d9516926f4b7a96b6b259 (patch)
tree568fe99fda52f1350fc0f244e7dfda5707d2b81e
parent8c30e87f16fefc68b467e591f6734100335e935d (diff)
parent2d57988c6a8e6b9f3b83b92f2094dba9d88ac87f (diff)
downloadsonivox-oreo-release.tar.gz
Change-Id: Id4d21e4d87f6e8f42e51326d2a4e636200f38f66
-rw-r--r--arm-wt-22k/lib_src/eas_wtsynth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arm-wt-22k/lib_src/eas_wtsynth.c b/arm-wt-22k/lib_src/eas_wtsynth.c
index 9fcda7b..8488fe2 100644
--- a/arm-wt-22k/lib_src/eas_wtsynth.c
+++ b/arm-wt-22k/lib_src/eas_wtsynth.c
@@ -28,6 +28,7 @@
*/
// includes
+#define LOG_TAG "SYNTH"
#include "log/log.h"
#include <cutils/log.h>
@@ -557,6 +558,14 @@ static EAS_BOOL WT_UpdateVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH
else
temp += (pVoice->note + pSynth->globalTranspose) * 100;
intFrame.frame.phaseIncrement = WT_UpdatePhaseInc(pWTVoice, pArt, pChannel, temp);
+ temp = pWTVoice->loopEnd - pWTVoice->loopStart;
+ if (temp != 0) {
+ temp = temp << NUM_PHASE_FRAC_BITS;
+ if (intFrame.frame.phaseIncrement > temp) {
+ ALOGW("%p phaseIncrement=%d", pWTVoice, (int)intFrame.frame.phaseIncrement);
+ intFrame.frame.phaseIncrement %= temp;
+ }
+ }
/* call into engine to generate samples */
intFrame.pAudioBuffer = pVoiceMgr->voiceBuffer;