Skip to content

A Node.js tool to control system volume on Windows

License

Notifications You must be signed in to change notification settings

DionisioII/node-audio-windows

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UPDATE

I rewrote the original library to be compatible with the modern Napi interface of NodeJS

Native Node.js volume controls for Windows

A native Windows API binding to control the default audio device. Supports set/get the volume and get the muted state and set the muted state.

npm npm

How to Use

const Controls  = require('node-audio-windows')
console.log(Controls)

JSVolumeControl = new Controls.JSVolumeControl()

JSVolumeControl.setMuted(false);
JSVolumeControl.setVolume(0.7)
console.log("\nvolume : " + JSVolumeControl.getVolume());

Note

Windows displays the audio at the scale from 0-100, but the library uses instead the scale 0.0 - 1.0 to match the scale Windows API actually uses.

Development

To build the project you need in Windows to install windows-build-tools in an elevated PowerShell prompt npm install --global --production windows-build-tools and then npm install or if you have node-gyp installed globally

$ node-gyp configure
$ node-gyp build

The repository contains a demo of the usage

$ node demo.js

Next steps

  • Expose the microphone API
  • Support controlling multiple audio devices

Licence & Copyright

Copyright (c) 2018 Jarno Lonardi The package node-audio-windows is licensed under MIT license.

About

A Node.js tool to control system volume on Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.6%
  • Python 4.0%
  • JavaScript 2.4%