forked from ChewbaccaCookie/voicemeeter-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ts
More file actions
42 lines (30 loc) · 1.17 KB
/
example.ts
File metadata and controls
42 lines (30 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { MacroButtonModes, StripProperties, Voicemeeter } from "voicemeeter-connector";
const vm = await Voicemeeter.init();
// Connect to your voicemeeter client
vm.connect();
// Sets gain of strip 0 to -10db
await vm.setStripParameter(0, StripProperties.Gain, -10);
// Get gain at -10db
console.log(vm.getStripParameter(0, StripProperties.Gain));
// Set gain to random number
await vm.setStripParameter(0, StripProperties.Gain, -Math.round(Math.random() * 40) + 10);
// Get random gain of strip 0
console.log(vm.getStripParameter(0, StripProperties.Gain));
// Disable VBAN
await vm.setOption("vban.Enable=0;");
// Get vban state
console.log(vm.getOption("vban.Enable"));
// Gets current audio levels of strip 0
console.log(`Left: ${vm.getLevel(0, 0)} Right: ${vm.getLevel(0, 1)}`);
// set MacroButton state
console.log(vm.setMacroButtonStatus(0, 1, MacroButtonModes.DEFAULT));
// get MacroButton state
console.log(vm.getMacroButtonStatus(0, MacroButtonModes.DEFAULT));
vm.attachChangeEvent(() => {
console.log("Something changed!");
});
// Disconnect voicemeeter client
setTimeout(() => {
vm.disconnect();
process.exit(0);
}, 5000);