Expand description
cpvc is a simple cross-platform audio control crate
Currently, cpvc supports the following platforms
- macOS
- Windows
- Linux (
pulse_audioonly)
To access platform specfic modules, you need to be on the specific OS This functionality may change in future versions
- macOS ->
coreaudio - windows ->
wasapi - linux ->
pulseaudio
§Controls Example
fn main() {
// Gets current system output device names (human readable ones)
let devices: Vec<String> = cpvc::get_sound_devices();
// Get current system volume for default output in %
let current_volume: u8 = cpvc::get_system_volume();
// Set system volume for default output in %
let volume: u8 = 32;
let success = cpvc::set_system_volume(volume);
// Mute default output
let success = cpvc::set_system_volume(0);
}Modules§
Traits§
Functions§
- get_
mute - get_
sound_ devices - Gathers the human readable device name of each output device detected
- get_
system_ volume - Gathers the current volume in percent of the default output device
- set_
mute - set_
system_ volume - Sets the current volume in percent of the default output device