Make sound work correctly during clock throttle mode

Fixes 
This commit is contained in:
nattthebear 2021-01-20 19:57:48 -05:00
parent 3c10a64fd5
commit d3917de1b3
2 changed files with 4 additions and 4 deletions
src/BizHawk.Client.EmuHawk

View File

@ -924,7 +924,7 @@ namespace BizHawk.Client.EmuHawk
if (form.ApplyNewSoundDevice)
{
Sound.Dispose();
Sound = new Sound(Handle, Config, Emulator.VsyncRate);
Sound = new Sound(Handle, Config, () => Emulator.VsyncRate());
Sound.StartSound();
}
else

View File

@ -433,7 +433,7 @@ namespace BizHawk.Client.EmuHawk
InputManager.AutofireStickyXorAdapter.SetOnOffPatternFromConfig(Config.AutofireOn, Config.AutofireOff);
try
{
Sound = new Sound(Handle, Config, Emulator.VsyncRate);
Sound = new Sound(Handle, Config, () => Emulator.VsyncRate());
}
catch
{
@ -446,7 +446,7 @@ namespace BizHawk.Client.EmuHawk
ShowMessageBox(owner: null, message, "Initialization Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Config.SoundOutputMethod = ESoundOutputMethod.Dummy;
Sound = new Sound(Handle, Config, Emulator.VsyncRate);
Sound = new Sound(Handle, Config, () => Emulator.VsyncRate());
}
Sound.StartSound();
@ -3324,7 +3324,7 @@ namespace BizHawk.Client.EmuHawk
else
{
_currentSoundProvider.SetSyncMode(SyncSoundMode.Sync);
_aviSoundInputAsync = new SyncToAsyncProvider(Emulator.VsyncRate, _currentSoundProvider);
_aviSoundInputAsync = new SyncToAsyncProvider(() => Emulator.VsyncRate(), _currentSoundProvider);
}
}