local lang = jarvis.context.language local helper = jarvis.context.command_path .. "\\_audio_devices.ps1" local cmd = string.format( 'powershell -NoProfile -ExecutionPolicy Bypass -File "%s" -Action list', helper ) local res = jarvis.system.exec(cmd) if not res.success then jarvis.log("error", "list devices failed: " .. tostring(res.stderr)) jarvis.audio.play_error() return { chain = false } end local lines = {} for line in (res.stdout or ""):gmatch("[^\r\n]+") do if line ~= "" then table.insert(lines, line) end end local title = lang == "ru" and "Устройства вывода" or "Output devices" local body if #lines == 0 then body = lang == "ru" and "Активных устройств не найдено" or "No active devices" else body = table.concat(lines, "\n") end jarvis.system.notify(title, body) jarvis.log("info", "audio devices: " .. body) jarvis.audio.play_ok() return { chain = false }