From 7983670c814c44712c8f62b8c726d54b7b04eb00 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 10 Mar 2024 00:03:30 -0500 Subject: [PATCH] #18 - When grabbing the device from the CLI, we now add it to a new var - We then add new var as the device so we can specify the group - Updated the default UDP port in the audio device for OP25 config --- client/discordAudioBot/dabSettings.mjs | 5 +++-- client/op25Handler/modules/op25ConfigGenerators.mjs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/discordAudioBot/dabSettings.mjs b/client/discordAudioBot/dabSettings.mjs index 05137e4..bc5815e 100644 --- a/client/discordAudioBot/dabSettings.mjs +++ b/client/discordAudioBot/dabSettings.mjs @@ -11,8 +11,9 @@ let type = "dshow"; if (os.platform() === 'linux') { await new Promise((res) => { executeCommand("pactl", ['list', 'short', 'sources']).then(cliOutput => { - device = extractValue(cliOutput, '(?:\\d(?:\\t|[\\s]{1,9})(?[\\w\\d\\-\\.\\_]+?)(?:\\t|[\\s]{1,9})(?[\\w\\d\\-\\.\\_]+)(?:\\t|[\\s]{1,9})(?:(?[\\w\\d\\-\\.\\_]+?) (?\\dch) (?\\d+Hz))(?:\\t|[\\s]{1,9})(?:IDLE|RUNNING|SUSPENDED))') - console.log("Device:", device.groups.device); + const extracted_device_details = extractValue(cliOutput, '(?:\\d(?:\\t|[\\s]{1,9})(?[\\w\\d\\-\\.\\_]+?)(?:\\t|[\\s]{1,9})(?[\\w\\d\\-\\.\\_]+)(?:\\t|[\\s]{1,9})(?:(?[\\w\\d\\-\\.\\_]+?) (?\\dch) (?\\d+Hz))(?:\\t|[\\s]{1,9})(?:IDLE|RUNNING|SUSPENDED))') + device = extracted_device_details.groups.device; + console.log("Device:", device); res(); }); }); diff --git a/client/op25Handler/modules/op25ConfigGenerators.mjs b/client/op25Handler/modules/op25ConfigGenerators.mjs index 6fdb9e4..a7d326b 100644 --- a/client/op25Handler/modules/op25ConfigGenerators.mjs +++ b/client/op25Handler/modules/op25ConfigGenerators.mjs @@ -150,7 +150,7 @@ class trunkingConfig { } class audioConfig { - constructor({ module = "sockaudio.py", port = 23457, deviceName = "default" }) { + constructor({ module = "sockaudio.py", port = 23456, deviceName = "default" }) { this.module = module; this.instances = [{ "instance_name": "audio0",