Fix choppy audio playback of sound effects on Windows

Increase default audio buffer size

See: #680
See: 25aeb1c5
This commit is contained in:
Jonathan G Rennison
2024-03-31 16:17:30 +01:00
parent 083a05a179
commit 9dc332ca59
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ const char *SoundDriver_Win32::Start(const StringList &parm)
wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign;
/* Limit buffer size to prevent overflows. */
_bufsize = GetDriverParamInt(parm, "samples", 1024);
_bufsize = GetDriverParamInt(parm, "samples", 2048);
_bufsize = std::min<int>(_bufsize, UINT16_MAX);
try {

View File

@@ -205,7 +205,7 @@ const char *SoundDriver_XAudio2::Start(const StringList &parm)
wfex.nAvgBytesPerSec = wfex.nSamplesPerSec * wfex.nBlockAlign;
// Limit buffer size to prevent overflows
int bufsize = GetDriverParamInt(parm, "samples", 1024);
int bufsize = GetDriverParamInt(parm, "samples", 2048);
bufsize = std::min<int>(bufsize, UINT16_MAX);
_voice_context = new StreamingVoiceContext(bufsize * 4);