Working on #13
- Running the 'pactl' command - Using regex on the output to find the active running device
This commit is contained in:
@@ -9,8 +9,12 @@ let type = "dshow";
|
|||||||
|
|
||||||
// Set Linux values for use in production
|
// Set Linux values for use in production
|
||||||
if (os.platform() === 'linux') {
|
if (os.platform() === 'linux') {
|
||||||
await executeCommand("pactl", ['list', 'short', 'sources']).then(cliOutput => {
|
await new Promise((res) => {
|
||||||
device = extractValue(cliOutput, '(?:\d[ ]{4,12}(.+?)[ ]{4,12}(?:.+?[ ]{4,12}){2,4}RUNNING)')
|
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
|
type = "pulse"; // Replace with appropriate type for Linux
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user