Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASAPICapture Initializes the client in a manner that disregards the rules in the API docs #1422

Open
aconverse opened this issue Sep 3, 2024 · 0 comments
Labels

Comments

@aconverse
Copy link

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

hr = m_AudioClient->Initialize(AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
200000,
0,
m_MixFormat,
nullptr);
The sample calls 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

@aconverse aconverse added the bug label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant