Skip to content

ymsyncer/win-audio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

win-audio

Get, Set and Watch Master Audio Volume

npm npm

Install

npm i --save win-audio

Requirements

node-gyp to build src/audio.cc

Usage

var audio = require('win-audio')

audio.polling(200)

audio.on('change', (volume) => {
  console.log("old %d%% -> new %d%%", volume.old, volume.new)
})

audio.set(75)

audio.increase(25)

audio.mute()

audio.decrease(10)

Functions

polling(interval)

  • Number interval: milliseconds for check volume changes. (Default 500)

get()

Return current percentage of volume.

set(value)

Set a new master volume.

  • Number value: percentage of new volume. [0-100]

increase(value)

Increase current volume of value %.

  • Number value: percentage. [0-100]

decrease(value)

Decrease current volume of value %.

  • Number value: percentage. [0-100]

mute()

Mute volume.

unmute()

Unmute volume.

toggleMute()

Mute/Unmute volume according to current status.

Events

change

Called when volume is changed.

Author

Francesco Cannizzaro

About

Get, Set and Watch Master Audio Volume on Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 51.4%
  • C++ 44.0%
  • Python 4.6%