#13 Finializing fix
- Updated the regex to double exclude '\' - Updated extractValue function to return the full result
This commit is contained in:
@@ -11,8 +11,8 @@ let type = "dshow";
|
||||
if (os.platform() === 'linux') {
|
||||
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);
|
||||
device = extractValue(cliOutput, '(?:\\d(?:\\t|[\\s]{1,9})(?<device>[\\w\\d\\-\\.\\_]+?)(?:\\t|[\\s]{1,9})(?<card>[\\w\\d\\-\\.\\_]+)(?:\\t|[\\s]{1,9})(?:(?<device_type>[\\w\\d\\-\\.\\_]+?) (?<channels>\\dch) (?<frequency>\\d+Hz))(?:\\t|[\\s]{1,9})(?:IDLE|RUNNING|SUSPENDED))')
|
||||
console.log("Device:", device.groups.device);
|
||||
res();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user