Skip to content

IAudioClient3::InitializeSharedAudioStream() returns AUDCLNT_E_INVALID_STREAM_FLAG if any flag other than AUDCLNT_STREAMFLAGS_EVENTCALLBACK is specified #1498

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

Conversation

davidebeatrici
Copy link
Contributor

@prmerger-automator
Copy link

@davidebeatrici : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@mvaneerde
Copy link
Contributor

mvaneerde commented Apr 21, 2023

Thank you for removing the stream flags that are incorrectly documented as being valid, even though they are, as you noticed, actually invalid for this method.
It may also be worth adding that the AUDCLNT_SESSIONFLAGS_XXX values are also valid:

  • AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED
  • AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE
  • AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED

EDIT: never mind, I see on closer reading that the session flags are already documented as being supported. So this change is correct.

@davidebeatrici
Copy link
Contributor Author

davidebeatrici commented Apr 22, 2023

No problem.

According to my testing, AUDCLNT_STREAMOPTIONS_MATCH_FORMAT (IAudioClient2::SetClientProperties()) is the proper replacement for AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM and presumably AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY as well.

As a bonus, IAudioClient::IsFormatSupported() can be relied on as it takes the properties into account.

Please note that AUDCLNT_E_UNSUPPORTED_FORMAT is returned when asking for upmixing or downmixing.

@drewbatgit drewbatgit merged commit e885b0d into MicrosoftDocs:docs Apr 24, 2023
@davidebeatrici davidebeatrici deleted the nf-audioclient-iaudioclient3-initializesharedaudiostream-invalid-flag branch April 25, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants