sound: fudge up some parameters of BufferedAsync. the most noticeable difference is that PAL NES with clock throttle no longer sounds horrible

This commit is contained in:
goyuken 2012-12-23 20:26:43 +00:00
parent cc05370809
commit 5f854466ab
2 changed files with 13 additions and 2 deletions

View File

@ -34,10 +34,20 @@ namespace BizHawk.Emulation.Sound
Queue<short> buffer = new Queue<short>(4096);
const int SamplesInOneFrame = 1470;
const int TargetExtraSamples = 882;
int SamplesInOneFrame = 1470;
int TargetExtraSamples = 882;
const int MaxExcessSamples = 4096;
/// <summary>
/// recalculates some internal parameters based on the IEmulator's framerate
/// </summary>
public void RecalculateMagic(double framerate)
{
// ceiling instead of floor here is very important (magic)
SamplesInOneFrame = (int)System.Math.Ceiling((88200.0 / framerate));
//TargetExtraSamples = ;// complete guess
}
public void DiscardSamples()
{
if(BaseSoundProvider != null)

View File

@ -109,6 +109,7 @@ namespace BizHawk.MultiClient
syncsoundProvider = null;
asyncsoundProvider = source;
semisync.BaseSoundProvider = source;
semisync.RecalculateMagic(Global.CoreComm.VsyncRate);
}
static int circularDist(int from, int to, int size)