mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-04 15:06:25 +00:00
Just figure out how many samples to read, then read it, instead of one-by-one.
This commit is contained in:
parent
e802fb0b73
commit
6782f7c75d
@ -502,13 +502,20 @@ void SasInstance::MixVoice(SasVoice &voice) {
|
||||
u32 sampleFrac = voice.sampleFrac;
|
||||
temp[tempPos++] = voice.resampleHist[0];
|
||||
temp[tempPos++] = voice.resampleHist[1];
|
||||
|
||||
int samplesToRead = 0;
|
||||
for (int i = delay; i < grainSize; i++) {
|
||||
while (sampleFrac >= PSP_SAS_PITCH_BASE) {
|
||||
voice.ReadSamples(&temp[tempPos++], 1);
|
||||
samplesToRead++;
|
||||
sampleFrac -= PSP_SAS_PITCH_BASE;
|
||||
}
|
||||
sampleFrac += voice.pitch;
|
||||
}
|
||||
voice.ReadSamples(&temp[tempPos], samplesToRead);
|
||||
tempPos += samplesToRead;
|
||||
|
||||
if (tempPos - 2 != samplesToRead)
|
||||
Crash();
|
||||
|
||||
sampleFrac = voice.sampleFrac;
|
||||
for (int i = delay; i < grainSize; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user