Working on #13
- Running the 'pactl' command - Using regex on the output to find the active running device
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user