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:
parent
cc05370809
commit
5f854466ab
|
@ -34,10 +34,20 @@ namespace BizHawk.Emulation.Sound
|
||||||
|
|
||||||
Queue<short> buffer = new Queue<short>(4096);
|
Queue<short> buffer = new Queue<short>(4096);
|
||||||
|
|
||||||
const int SamplesInOneFrame = 1470;
|
int SamplesInOneFrame = 1470;
|
||||||
const int TargetExtraSamples = 882;
|
int TargetExtraSamples = 882;
|
||||||
const int MaxExcessSamples = 4096;
|
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()
|
public void DiscardSamples()
|
||||||
{
|
{
|
||||||
if(BaseSoundProvider != null)
|
if(BaseSoundProvider != null)
|
||||||
|
|
|
@ -109,6 +109,7 @@ namespace BizHawk.MultiClient
|
||||||
syncsoundProvider = null;
|
syncsoundProvider = null;
|
||||||
asyncsoundProvider = source;
|
asyncsoundProvider = source;
|
||||||
semisync.BaseSoundProvider = source;
|
semisync.BaseSoundProvider = source;
|
||||||
|
semisync.RecalculateMagic(Global.CoreComm.VsyncRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int circularDist(int from, int to, int size)
|
static int circularDist(int from, int to, int size)
|
||||||
|
|
Loading…
Reference in New Issue