Fix choppy audio playback of sound effects on Windows

Increase default audio buffer size

See: #680
See: 25aeb1c5
pull/684/head
Jonathan G Rennison 2 months ago
parent 083a05a179
commit 9dc332ca59

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

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

Loading…
Cancel
Save