pulsectl-rs

Crates.iopulsectl-rs
lib.rspulsectl-rs
version0.3.2
sourcesrc
created_at2021-08-13 02:05:07.68039
updated_at2021-08-15 00:43:28.436297
descriptionA higher level API for libpulse-binding
homepagehttps://github.com/SeaDve/pulsectl-rs
repositoryhttps://github.com/SeaDve/pulsectl-rs
max_upload_size
id435484
size90,781
Dave Patrick (SeaDve)

documentation

README

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 JojiiOfficial/pulsectl-rust-fork which is then a fork of krruzic/pulsectl-rust.

Example

List all currently connected playback devices.

use pulsectl::controllers::SinkController;
use pulsectl::controllers::DeviceControl;

// create handler that calls functions on playback devices and apps
let mut handler = SinkController::create().unwrap();

let devices = handler
    .list_devices()
    .expect("Could not get list of playback devices.");
    
println!("Playback Devices: ");
for dev in devices.clone() {
    println!(
        "[{}] {}, Volume: {}",
        dev.index,
        dev.description.as_ref().unwrap(),
        dev.volume.print()
    );
}

For more detailed examples, check the examples directory.

Commit count: 67

cargo fmt