🎚️ Rust library for observing/modifying PulseAudio volumes and the default source/sink
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE.md | ||
README.md | ||
rustfmt.toml |
pulseaudio-volume-interface
Rust library for observing/modifying PulseAudio volumes and the default source/sink.
Usage example
use pulseaudio_volume_interface::PulseAudioVolumeInterface;
fn main() {
let pa_volume_interface = PulseAudioVolumeInterface::new("deckster handler".to_owned());
// Wait for the data to load.
// Because of PulseAudio, there is no way to know when everything is ready, so we have to just hope a second is enough.
sleep(Duration::from_secs(1));
let full_state = pa_volume_interface.current_state();
let entities_by_id = full_state.entities_by_id();
for (id, state) in entities_by_id {
println!("{id}: {:#?}\n", state.metadata());
}
}
License
This project is available under the permissive Blue Oak Model License 1.0.0.