pulsectl2-rs 0.3.3

A higher level API for libpulse-binding
Documentation
  • Coverage
  • 66.96%
    75 out of 112 items documented1 out of 36 items with examples
  • Size
  • Source code size: 93.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.21 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 23s Average build duration of successful builds.
  • all releases: 1m 23s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • mati865/pulsectl2-rs
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mati865

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

Example

List all currently connected playback devices.

Cargo.toml:

[dependencies]
pulsectl2-rs = "0.3"

src/main.rs:

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().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.