zyd-loudness
v0.0.1
Published
由于electron安装node-loundness运行项目adjust_get_current_system_volume_vista_plus.exe文件找不到,对loundess进行了更改,主要是更改了运行及打包后的路径
Downloads
5
Readme
node-loudness
由于electron安装node-loundness运行项目adjust_get_current_system_volume_vista_plus.exe文件找不到,对loundess进行了更改,主要是更改了运行及打包后的路径
eletron 进行开发和生产环境配置
开发环境.env.development文件配置 NODE_ENV='development' 生产环境.env.production文件设配置 NODE_ENV='production'
electron打包配置
在build里面配置如下 extraResources: [ { "from": "node_modules/loudness/impl/windows/adjust_get_current_system_volume_vista_plus.exe", "to": "./extraResources/adjust_get_current_system_volume_vista_plus.exe" } ]
Usage
The library currently has support for four simple async functions. The volume is specified as an integer between 0 and 100 (inc.).
const loudness = require('loudness')
await loudness.setVolume(45)
const vol = await loudness.getVolume()
// vol = 45
await loudness.setMuted(false)
const mute = await loudness.getMuted()
// mute = false
OS Support
Currently macOS, Windows (>= Vista) and Linux (ALSA) is supported, please send a pull request if you are using another setup.