Initial commit - 按新规范整理目录结构

- Code/: 源代码、配置文件、文档、工具
- Releases/: 发布包(v1.0)
- Test/: 测试用例和测试脚本
This commit is contained in:
2026-03-20 06:54:40 +08:00
commit 45e7d9553a
29 changed files with 5068 additions and 0 deletions

View File

@@ -0,0 +1,181 @@
# 远程音量监控工具 V1.0
Windows 远程连接音量自动调节器 - 检测到 RDP 远程连接时自动调整系统音量
---
## 🚀 快速开始
### 1. 安装依赖工具(推荐)
下载 nircmd.exe 放到 `tools` 文件夹:
- 64 位https://www.nirsoft.net/utils/nircmd-x64.zip
- 32 位https://www.nirsoft.net/utils/nircmd.zip
解压后将 `nircmd.exe` 复制到 `tools\` 目录
### 2. 运行程序
**方式 1使用启动脚本**
```bat
scripts\启动监控.bat
```
**方式 2直接运行**
```bat
python src\remote_volume_monitor.py
```
**方式 3测试模式**
```bat
python src\remote_volume_monitor.py --test
```
---
## 📋 功能特性
- ✅ 自动检测 RDP 远程连接/断开
- ✅ 连接时自动降低音量(默认 30%
- ✅ 断开时自动恢复音量(默认 80%
- ✅ 零第三方 Python 依赖
- ✅ 支持 nircmd/Core Audio/PowerShell 多种方案
- ✅ 配置文件可自定义
- ✅ 后台服务模式
---
## ⚙️ 配置说明
编辑 `config\config.ini`
```ini
[volume]
# 远程连接时的音量 (0-100)
remote_volume = 30
# 本地使用时的音量 (0-100)
local_volume = 80
[monitor]
# 检测间隔(秒)
check_interval = 5
[behavior]
# 连接时调整音量
adjust_on_connect = true
# 断开时恢复音量
adjust_on_disconnect = true
```
---
## 📁 文件结构
```
remote-volume-monitor-v1.0/
├── src/
│ └── remote_volume_monitor.py # 主程序
├── config/
│ └── config.ini # 配置文件
├── tools/
│ ├── README.md # 工具说明
│ └── nircmd.exe # 音量工具(需自行放入)
├── scripts/
│ └── 启动监控.bat # 启动脚本
├── docs/
│ ├── 部署检查清单_远程音量控制.md
│ └── 音量控制方案说明.md
├── logs/ # 日志目录(运行时自动创建)
├── README.md # 本文件
└── requirements.txt # 依赖说明
```
---
## 🧪 常用命令
```bash
# 测试模式(检测一次后退出)
python src\remote_volume_monitor.py --test
# 获取当前音量
python src\remote_volume_monitor.py --get-volume
# 设置音量
python src\remote_volume_monitor.py --set-volume 50
# 创建配置文件
python src\remote_volume_monitor.py --create-config
# 启动监控
python src\remote_volume_monitor.py
# 使用启动脚本
scripts\启动监控.bat
```
---
## 📊 系统要求
- **操作系统:** Windows 10/11
- **Python** 3.8 或更高版本
- **权限:** 普通用户权限即可(安装服务需要管理员)
- **音频设备:** 必须有活跃的音频输出设备
---
## 🐛 故障排查
### 问题 1无法检测 RDP 连接
**检查:**
```bash
python src\test_rdp_detection.py
```
### 问题 2音量无法调节
**解决:**
1. 确认已下载 nircmd.exe 放到 `tools` 文件夹
2. 检查 Windows Audio 服务是否运行
3. 查看日志文件 `logs\remote_volume.log`
### 问题 3断开 RDP 后音量不恢复
**检查:**
```bash
python src\test_rdp_disconnect.py
```
---
## 📖 详细文档
- **部署指南:** `docs\部署检查清单_远程音量控制.md`
- **音量方案:** `docs\音量控制方案说明.md`
- **工具说明:** `tools\README.md`
---
## 📝 版本信息
- **版本号:** V1.0
- **发布日期:** 2026-03-07
- **依赖:** 零第三方 Python 依赖
- **推荐工具:** nircmd.exe35KB 免费工具)
---
## 📞 技术支持
查看日志文件获取详细信息:
```
logs\remote_volume.log
```
---
*远程音量监控工具 V1.0 - 零依赖版本*