summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2022-08-16 19:11:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-08-16 19:11:23 +0000
commit64b009bd048fe39ade89f13324cfd7dfb5b2f127 (patch)
treee484fb25d9196aa2588717be3c7b9049efd2b240
parentbc685c9b6b3eca629b4dffb84cfb5c96aab6d9c2 (diff)
parentc7858204da86277eb868b44d49ac0d5992af0840 (diff)
downloadsonivox-64b009bd048fe39ade89f13324cfd7dfb5b2f127.tar.gz
Merge "DO NOT MERGE - Merge Android 13"main-16k
-rw-r--r--arm-wt-22k/lib_src/eas_dlssynth.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arm-wt-22k/lib_src/eas_dlssynth.c b/arm-wt-22k/lib_src/eas_dlssynth.c
index 8606a29..a07262c 100644
--- a/arm-wt-22k/lib_src/eas_dlssynth.c
+++ b/arm-wt-22k/lib_src/eas_dlssynth.c
@@ -348,11 +348,24 @@ EAS_RESULT DLS_StartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOIC
pWTVoice->phaseAccum = (EAS_U32) pSynth->pDLS->pDLSSamples + pSynth->pDLS->pDLSSampleOffsets[pDLSRegion->wtRegion.waveIndex];
if (pDLSRegion->wtRegion.region.keyGroupAndFlags & REGION_FLAG_IS_LOOPED)
{
+#if defined (_8_BIT_SAMPLES)
pWTVoice->loopStart = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopStart;
pWTVoice->loopEnd = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopEnd - 1;
+#else //_16_BIT_SAMPLES
+ pWTVoice->loopStart = pWTVoice->phaseAccum + (pDLSRegion->wtRegion.loopStart<<1);
+ pWTVoice->loopEnd = pWTVoice->phaseAccum + (pDLSRegion->wtRegion.loopEnd<<1) - 2;
+#endif
}
else
- pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 1;
+ {
+#if defined (_8_BIT_SAMPLES)
+ pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum
+ + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 1;
+#else //_16_BIT_SAMPLES
+ pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum
+ + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 2;
+#endif
+ }
return EAS_SUCCESS;
}