Enhance Audio Device Management: Volume and Mute Control Features #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This submission introduces a set of functionalities for more effective management of audio device volume and mute status. With these changes, users can set and retrieve volume levels and mute status on specified audio devices, enhancing the flexibility and usability of audio control.
Key Changes
setVolumeForDevice function: Allows users to set the volume of a specified device, taking the device ID and volume percentage (0-100) as parameters.
getVolumeForDevice function: Enables users to retrieve the current volume of a specified device, returning it as a percentage.
setMuteForDevice function: Gives users the ability to set the mute status of a specified device, accepting the device ID and a boolean value (true/false) as parameters.
getMuteForDevice function: Allows users to check the mute status of a specified device, returning 1 for muted and 0 for unmuted.
Added Python interface support for the new functionalities, allowing users to easily call these features from Python code.
Updated the getDevices method to include the device ID in the return values for easier subsequent operations.
Code Example
Here’s an example of how to use the new functionalities: