osx-volume-controls
Control volume on OSX
Last updated 4 years ago by benjifs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install osx-volume-controls 
SYNC missed versions from official npm registry.

osx-volume-controls

Control volume on OSX

Installation

$ npm install osx-volume-controls

API

state([callback])

Get volume and mute state in callback. The value of volume and mute will be passed as the second argument in the callback.

volumeState([callback])

Get volume state in callback. The value of volume will be passed as the second argument in the callback.

muteState([callback])

Get mute state in callback. The value of mute will be passed as the second argument in the callback.

set(vol, [callback])

Set volume to vol.

increase([callback])

Increase volume by 10%.

decrease([callback])

Decrease volume by 10%.

mute([callback])

Mute volume.

unmute([callback])

Unmute volume.

Usage

var Volume = require('osx-volume-controls')

Volume.state(function(err, rtn) {
	console.log("Volume: " + rtn[0] + " mute: " + rtn[1]);
});
Volume.volumeState(function(err, rtn) {
	console.log("Volume: " + rtn);
});
Volume.muteState(function(err, rtn) {
	console.log("Mute: " + rtn);
});
Volume.increase(function() {
	Volume.volumeState(function(err, rtn) {
		console.log("Volume: " + rtn);
	});
});
Volume.mute();
Volume.set(87); // Set volume to 87%

License

MIT © Benji Encalada

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 1
This Week 3
This Month 3
Last Day 0
Last Week 0
Last Month 5
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |