SPU2-X: More volume! Expect to have to turn your speakers down a bit. (made possible by proper clamping)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3419 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-07 19:20:53 +00:00
parent a16f8b6bc4
commit b62dbc545a
2 changed files with 10 additions and 9 deletions

View File

@ -775,14 +775,13 @@ __forceinline void Mix()
}
else
{
// SndOutVolumeShift + 1 because sound output is notoriously too quiet (rama)
Out.Left = MulShr32( Out.Left<<(SndOutVolumeShift+1), Cores[1].MasterVol.Left.Value );
Out.Right = MulShr32( Out.Right<<(SndOutVolumeShift+1), Cores[1].MasterVol.Right.Value );
Out.Left = MulShr32( Out.Left<<(SndOutVolumeShift+2), Cores[1].MasterVol.Left.Value );
Out.Right = MulShr32( Out.Right<<(SndOutVolumeShift+2), Cores[1].MasterVol.Right.Value );
// Final Clamp!
// This could be circumvented by using 1/2th total output volume, although
// I suspect this approach (clamping at the higher volume) is more true to the
// PS2's real implementation.
// Like any good audio system, the PS2 pumps the volume and incurs some distortion in its
// output, giving us a nice thumpy sound at times. So we add 2 above (4x volume pump) and
// then clamp it all here.
Out = clamp_mix( Out, SndOutVolumeShift );
}

View File

@ -22,9 +22,11 @@
// SndOut.
static const int SndOutPacketSize = 64;
// Overall master volume shift.
// Converts the mixer's 32 bit value into a 16 bit value.
static const int SndOutVolumeShift = 13;
// Overall master volume shift; this is meant to be a precision value and does not affect
// actual output volumes. It converts SPU2 16 bit volumes to 32-bit volumes, and likewise
// downsamples 32 bit samples to 16 bit sound driver output (this way timestretching and
// DSP effects get better precision results)
static const int SndOutVolumeShift = 12;
// Samplerate of the SPU2. For accurate playback we need to match this
// exactly. Trying to scale samplerates and maintain SPU2's Ts timing accuracy