forked from abhaybuch/node-mac-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (20 loc) · 746 Bytes
/
index.js
File metadata and controls
23 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let platform_utils;
if (process.platform === 'darwin') {
platform_utils = require("bindings")("mac_utils.node");
} else if (process.platform === 'win32') {
platform_utils = require("bindings")("win_utils.node");
} else {
throw new Error('Unsupported platform');
}
module.exports = {
// Common exports that work on all platforms
getRunningInputAudioProcesses: platform_utils.getRunningInputAudioProcesses,
INFO_ERROR_CODE: 1,
ERROR_DOMAIN: "com.MicrophoneUsageMonitor",
// Mac-specific exports
...(process.platform === 'darwin' ? {
makeKeyAndOrderFront: platform_utils.makeKeyAndOrderFront,
startMonitoringMic: platform_utils.startMonitoringMic,
stopMonitoringMic: platform_utils.stopMonitoringMic,
} : {})
};