AppVolume Addon
Read and control Windows audio sessions per application — ideal for per-app volume sliders and mute toggles.
import { addon } from "novadesk";
const appVolume = addon.load("path/to/AppVolume.dll");INFO
This API comes from the AppVolume addon, not the built-in system module.
Table of Contents
Returns all active Windows output audio sessions. Each session maps to an application currently playing (or having recently played) audio.
Each session object has:
| Property | Type | Description |
|---|---|---|
pid | number | Process ID. |
processName | string | Executable file name (e.g. chrome.exe). |
fileName | string | Executable file name. |
filePath | string | Full executable path when available. |
iconPath | string | Extracted .ico path cached in temp, or empty string. |
displayName | string | Session display name. |
volume | number | Session volume 0.0–1.0. |
peak | number | Peak level 0.0–1.0. |
muted | boolean | Whether the session is muted. |
object[] Array of audio session objects. Returns an empty array if enumeration fails.const sessions = appVolume.listSessions();
console.log("Active sessions:", sessions.length);
for (const s of sessions) {
console.log(s.processName, "vol:", s.volume, "muted:", s.muted);
}Gets aggregated volume details for all sessions belonging to a process ID. Returns the average volume, peak maximum, and whether any session is muted.
The returned object has: volume (average, 0.0–1.0), muted (true if any session is muted), peak (maximum peak).
PARAMETERS
object | null Aggregated volume info for matching sessions, or null if no session matches the PID.const s = appVolume.listSessions()[0];
const info = appVolume.getByPid(s.pid);
if (info) {
console.log("Volume:", info.volume, "Muted:", info.muted);
}Same as getByPid() but matches by process name. Case-insensitive.
PARAMETERS
object | null Aggregated volume info for matching sessions, or null if no session matches the name.const info = appVolume.getByProcessName("Spotify.exe");
if (info) console.log("Spotify volume:", info.volume);Sets the volume for all audio sessions belonging to a process ID.
PARAMETERS
boolean true if at least one matching session was updated, false otherwise.const s = appVolume.listSessions()[0];
appVolume.setVolumeByPid(s.pid, 0.5); // 50%Sets the volume for all audio sessions matching a process name.
PARAMETERS
boolean true if at least one matching session was updated, false otherwise.appVolume.setVolumeByProcessName("chrome.exe", 0.3); // 30%Mutes or unmutes all audio sessions belonging to a process ID.
PARAMETERS
boolean true if at least one matching session was updated, false otherwise.const s = appVolume.listSessions()[0];
appVolume.setMuteByPid(s.pid, true);Mutes or unmutes all audio sessions matching a process name.
PARAMETERS
boolean true if at least one matching session was updated, false otherwise.appVolume.setMuteByProcessName("Spotify.exe", true);Full Example
import { addon } from "novadesk";
const appVolume = addon.load("path/to/AppVolume.dll");
const sessions = appVolume.listSessions();
if (sessions.length > 0) {
const first = sessions[0];
console.log("App:", first.processName, "Vol:", first.volume, "Muted:", first.muted);
appVolume.setVolumeByProcessName(first.processName, 0.5);
appVolume.setMuteByPid(first.pid, false);
const agg = appVolume.getByPid(first.pid);
console.log("Aggregated:", agg);
}