mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 03:44:32 +01:00
Merge pull request #965 from raven02/patch-4
Better do volume shift in sasAudio
This commit is contained in:
commit
671818edc8
2 files changed
+6
-6
No files matched your search
+2
-2
@@ -206,8 +206,8 @@ u32 sceSasSetVolume(u32 core, int voiceNum, int leftVol, int rightVol, int effec
|
||||
}
|
||||
|
||||
SasVoice &v = sas->voices[voiceNum];
|
||||
v.volumeLeft = (leftVol << 3);
|
||||
v.volumeRight = (rightVol << 3);
|
||||
v.volumeLeft = leftVol;
|
||||
v.volumeRight = rightVol;
|
||||
v.effectLeft = effectLeftVol;
|
||||
v.effectRight = effectRightVol;
|
||||
return 0;
|
||||
|
||||
@@ -313,10 +313,10 @@ void SasInstance::Mix(u32 outAddr) {
|
||||
// We mix into this 32-bit temp buffer and clip in a second loop
|
||||
// Ideally, the shift right should be there too but for now I'm concerned about
|
||||
// not overflowing.
|
||||
mixBuffer[i * 2] += sample * voice.volumeLeft >> 15;
|
||||
mixBuffer[i * 2 + 1] += sample * voice.volumeRight >> 15;
|
||||
sendBuffer[i * 2] += sample * voice.volumeLeftSend >> 15;
|
||||
sendBuffer[i * 2 + 1] += sample * voice.volumeRightSend >> 15;
|
||||
mixBuffer[i * 2] += sample * voice.volumeLeft >> 12;
|
||||
mixBuffer[i * 2 + 1] += sample * voice.volumeRight >> 12;
|
||||
sendBuffer[i * 2] += sample * voice.volumeLeftSend >> 12;
|
||||
sendBuffer[i * 2 + 1] += sample * voice.volumeRightSend >> 12;
|
||||
voice.envelope.Step();
|
||||
}
|
||||
voice.sampleFrac = sampleFrac;
|
||||
|
||||
Reference in new issue
Block a user