Browse Source

Fix audio client initialization parameters

https://learn.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-initialize

When WAASPI exclusive mode is on, I don't think it plays audio correctly. Also docs say: 
> For an exclusive-mode stream that uses event-driven buffering, the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, and the values of these two parameters must be equal

https://pastebin.com/fEz4ED12
pull/201/head
Anthony La 1 month ago
committed by GitHub
parent
commit
8ca4d37fb0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      modules/audio_output/wasapi.c

6
modules/audio_output/wasapi.c

@ -895,8 +895,10 @@ static HRESULT Start(aout_stream_t *s, audio_sample_format_t *restrict pfmt,
msg_Dbg(s, "audio device configured as s24");
hr = IAudioClient_Initialize(sys->client, shared_mode,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
buffer_duration, 0, pwf, sid);
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
buffer_duration,
shared_mode == AUDCLNT_SHAREMODE_EXCLUSIVE ? buffer_duration : 0,
pwf, sid);
CoTaskMemFree(pwf_closest);
if (FAILED(hr))
{

Loading…
Cancel
Save