Coder Social home page Coder Social logo

halli2 / pulsectl-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duhdugg/pulsectl-rs

0.0 0.0 0.0 1.58 MB

A higher level API for libpulse-binding

Home Page: https://seadve.github.io/pulsectl-rs/pulsectl/

License: GNU General Public License v3.0

Rust 100.00%

pulsectl-rs's Introduction

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.

pulsectl-rs's People

Contributors

duhdugg avatar halli2 avatar jojiiofficial avatar krruzic avatar manuelvo avatar seadve avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.