raspberry-vol

1.1.0 • Public • Published

raspberry-vol

Get and set volume in Linux systems.

since pactl not exists on raspberry, i decided to use amixer feature

Install

$ npm install --save raspberry-vol

Usage

var raspVol = require('raspberry-vol');
 
raspVol.get(function (err, level) {
    console.log(level);
    //=> 90
});
 
raspVol.set(90, function (err) {
    console.log('Changed volume to 90%');
});

API

.get(callback)

Get volume level.

callback(err, level)

Type: function

level

Type: number

Current volume level.

.set(level, callback)

Set volume level.

level

Required Type: number

A number between 0 and 100.

callback(err)

Type: function

Returns nothing but a possible exception.

CLI

See the vol CLI.

License

MIT © Serkan Polat

Package Sidebar

Install

npm i raspberry-vol

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

4.87 kB

Total Files

6

Last publish

Collaborators

  • serkanp