FR: Add volume and mute controls to Device

Open
#551 25 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

Start by reading the Device API and the platform-specific audio backends to see how volume and mute controls could be supported across input and output devices. The issue is stale, with 25 comments and the last comment 394 days ago; check the discussion for any decided approach before estimating the work. Done means exposing the requested mute and volume getters and setters for supported devices.

Written by the indexing model from the issue text.

Description

host-specific feature

I want to be able to use this library to control the volume and mute state of input and output Devices, ie:

let input_device = host.default_input_device().unwrap();
println!("microphone mute state: {}", input_device.get_mute());
input_device.set_mute(true);

let output_device = host.default_output_device().unwrap();
println!("output device volume: {} dB, {}%",
    output_device.get_volume_db(),
    output_device.get_volume_scalar() * 100);

// Set output volume to -10dB
output_device.set_volume_db(-10.);
// Set output volume to "scalar" 50% of maximum
output_device.set_volume_scalar(0.5);
Dominant language
Rust
Stars
4k
Forks
554
Avg merge
1d 3h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RustAudio/cpal

All issues in RustAudio/cpal

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.