Rust PulseAudio API

docs crates.io CI

pulsectl is a high level wrapper around the PulseAudio bindings supplied by libpulse-binding to make application development easier. It provides simple access to sinks, inputs, sources and outputs allowing one to write audio control programs with ease. This library is only capable of modifying PulseAudio data (e.g., changing volume, routing applications, and muting).

This is a fork of pulsectl-rust-fork which is then a fork of pulsectl-rust.

Usage

Connect to PulseAudio by creating a SinkController for audio playback devices and apps or a SourceController for audio recording devices and apps.

```rust // Simple application that lists all playback devices and their status // See examples/changedevicevol.rs for a more complete example extern crate pulsectl;

use std::io;

use pulsectl::controllers::SinkController; use pulsectl::controllers::DeviceControl; fn main() { // create handler that calls functions on playback devices and apps let mut handler = SinkController::create(); let devices = handler .listdevices() .expect("Could not get list of playback devices"); println!("Playback Devices"); for dev in devices.clone() { println!( "[{}] {}, [Volume: {}]", dev.index, dev.description.asref().unwrap(), dev.volume.print() ); } } ```