musicsound

1.0.4 • Public • Published

SoundControl

A simple Node.js library for controlling/getting system audio volume (compatible with Windows, Linux, macOS).

installation:

npm i musicsound

Setup and Usage:

The library exposes a class called operatingSystem. This class contains two functions: setVolume, which takes a volume level as a parameter, and getVolume, which returns the current volume level. Both functions return promises, either resolving with the specified volume level or rejecting with an error if applicable. The library is designed to work seamlessly across different operating systems.

Example:

const { operatingSystem } = require("musicsound");
// prettier-ignore
operatingSystem.getVolume().then(vol => console.log(vol)).catch(err => console.log(err))
// prettier-ignore
operatingSystem.setVolume(50).then(vol => console.log(vol)).catch(err => console.log(err))

Readme

Keywords

none

Package Sidebar

Install

npm i musicsound

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

2.93 kB

Total Files

3

Last publish

Collaborators

  • elhananfine