Control volume on OSX
$ npm install osx-volume-controls
Get volume and mute state in callback. The value of volume
and mute
will be passed as the second argument in the callback.
Get volume state in callback. The value of volume
will be passed as the second argument in the callback.
Get mute state in callback. The value of mute
will be passed as the second argument in the callback.
Set volume to vol
.
Increase volume by 10%.
Decrease volume by 10%.
Mute volume.
Unmute volume.
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%
MIT © Benji Encalada