Working on #13

- Running the 'pactl' command
- Using regex on the output to find the active running device
This commit is contained in:
Logan Cusano
2024-03-08 21:58:27 -05:00
parent b7d4cbf46c
commit 3cb53605c7

View File

@@ -9,9 +9,13 @@ let type = "dshow";
// Set Linux values for use in production
if (os.platform() === 'linux') {
await executeCommand("pactl", ['list', 'short', 'sources']).then(cliOutput => {
device = extractValue(cliOutput, '(?:\d[ ]{4,12}(.+?)[ ]{4,12}(?:.+?[ ]{4,12}){2,4}RUNNING)')
});
await new Promise((res) => {
executeCommand("pactl", ['list', 'short', 'sources']).then(cliOutput => {
device = extractValue(cliOutput, '(?:\d[ ]{4,12}(.+?)[ ]{4,12}(?:.+?[ ]{4,12}){2,4}RUNNING)')
console.log("Device:", device);
res();
});
});
type = "pulse"; // Replace with appropriate type for Linux
}