Skip to content

Add set_client_properties method to cover all AudioClientProperties - #48

Merged
HEnquist merged 8 commits into
HEnquist:masterfrom
edvard-pettersen-elas-ai:user/edvardsp/audio-client-properties
Sep 9, 2025
Merged

HEnquist merged 8 commits into
HEnquist:masterfrom
edvard-pettersen-elas-ai:user/edvardsp/audio-client-properties

Conversation

@edvard-pettersen-elas-ai

@edvard-pettersen-elas-ai edvard-pettersen-elas-ai commented Aug 29, 2025 •

Copy link
Copy Markdown

The existing method set_audio_stream_category only covers the eCategory member of AudioClientProperties. The two other members, bIsOffload and Options, are equally useful for certain use-cases, specifically if you want to enable usage of offload pin or specify specific options such as raw pin (AUDCLNT_STREAMOPTIONS_RAW).

This PR implements set_client_properties which gives access to all properties under AudioClientProperties.

@HEnquist

Copy link
Copy Markdown
Owner

Thanks for the PR! So this new method covers the functionality of that existing method and more. It would be helpful if the documentation mentioned how the two methods related.

@edvard-pettersen-elas-ai

Copy link
Copy Markdown
Author

@HEnquist, correct. I can extend the docs for set_audio_stream_category to point to the new method. Does it make sense to mark set_audio_stream_category as deprecated as well? Can have it be deprecated by next major or minor bump.

@HEnquist

HEnquist commented Sep 6, 2025

Copy link
Copy Markdown
Owner

Yes it would make sense to deprecate the existing method. But I'm thinking that the new method could make it easy to use the defaults for the properties you don't want to change, by making it take Option on all the properties. That way I could use it to set only for example offload, by giving Some there, and None for category and stream options that I just want to leave at their defaults (without having to know what those defaults are).

@edvard-pettersen-elas-ai

Copy link
Copy Markdown
Author

@HEnquist, I see your point. I believe making a wrapper around AudioClientProperties and turn it into a proper builder type is ergonomically better in that scenario. I have pushed a version where I define a first class safe wrapper around AudioClientProperties with first class definitions of StreamCategory and StreamOption. Note that setting both category and option supports either the safe type or the direct constant from windows crate.

@HEnquist

HEnquist commented Sep 9, 2025

Copy link
Copy Markdown
Owner

Thanks for these changes, looks perfect now. I'm merging this, and then I'll make a new release asap.

@HEnquist
HEnquist merged commit 2e8b67a into HEnquist:master Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants