-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Which sample are you reporting a bug in?
Example: WASAPICapture
Describe the bug
The WASAPICapture seems to Initialize the client in a way that's forbidden according to the API documentation.
At
Windows-universal-samples/Samples/WindowsAudioSession/cpp/WASAPICapture.cpp
Lines 230 to 235 in 0db108e
| hr = m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED, | |
| AUDCLNT_STREAMFLAGS_EVENTCALLBACK, | |
| 200000, | |
| 0, | |
| m_MixFormat, | |
| nullptr); |
IAudioClient::Initialize with on a shared mode (AUDCLNT_SHAREMODE_SHARED), event driven (AUDCLNT_STREAMFLAGS_EVENTCALLBACK) stream with an hnsBufferDuration of 200000 (20 ms)
But the API documentation at https://learn.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-initialize clearly states:
"For a shared-mode stream that uses event-driven buffering, the caller must set both hnsPeriodicity and hnsBufferDuration to 0."
But in the above call hnsBufferDuration is demonstrably non-zero.
To Reproduce
Steps to reproduce the behavior:
N/A Docs mismatch
Expected behavior
I expect the sample to conform the the rules for calling the API.
Screenshots
If applicable, add screenshots to help explain your problem.
Configuration
- Language/architecture/flavor: example: C++ x64 Debug
- Windows platform and build number: 22631.4037
- Visual Studio version: 17.11.2
Additional context
N/A