Automated process to detect WeMeet meeting invitations in WeChat, join them, and record the audio to MP3 files.
- Cross-Platform: Supports Windows, macOS, and Linux.
- Resolution Independent: Uses OCR and URL schemes instead of hardcoded coordinates.
- Automatic Recording: Records system audio directly to MP3 using loopback.
- Robust Error Handling: Modular architecture with status verification and detailed logging.
- Tesseract OCR: Required for reading text from windows.
- Windows: Download installer from UB Mannheim.
- macOS:
brew install tesseract - Linux:
sudo apt install tesseract-ocr(Installtesseract-ocr-chi-simfor Chinese support).
- FFmpeg: Required for MP3 conversion.
- Windows: Download FFmpeg and add to PATH.
- macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg
- Windows: Uses WASAPI loopback (built-in). No extra driver needed.
- macOS: Requires a virtual audio driver like BlackHole 2ch. Download here. Set system output to "BlackHole 2ch" during meetings.
- Linux: Uses PulseAudio/PipeWire monitor sinks (built-in). The script handles switching automatically.
- Install dependencies:
uv sync
- Test your environment:
PYTHONPATH=. uv run python src/tests/test_env.py PYTHONPATH=. uv run python src/tests/test_audio.py
- Run the agent:
PYTHONPATH=. uv run python main.py
该项目实现了一个自动化流程:监测微信中的腾讯会议邀请,自动加入会议,并将会议音频实时录制为 MP3 文件。
- 跨平台支持: 支持 Windows, macOS 和 Linux。
- 分辨率无关: 使用 OCR 文字识别和 URL Scheme,而非硬编码的坐标,适配各种显示分辨率。
- 自动录音: 使用回环(Loopback)技术直接将系统声音录制为 MP3。
- 稳定可靠: 模块化架构,具备状态校验和详细的日志记录。
- Tesseract OCR: 用于识别窗口中的文字。
- Windows: 从 UB Mannheim 下载安装程序。
- macOS: 执行
brew install tesseract。 - Linux: 执行
sudo apt install tesseract-ocr(建议安装tesseract-ocr-chi-sim以支持中文)。
- FFmpeg: 用于 MP3 格式转换。
- Windows: 下载 FFmpeg 并将其 bin 目录添加到系统环境变量 PATH。
- macOS: 执行
brew install ffmpeg。 - Linux: 执行
sudo apt install ffmpeg。
- Windows: 使用内置的 WASAPI Loopback,无需额外驱动。
- macOS: 需要安装虚拟音频驱动 BlackHole 2ch 下载地址。会议期间需将系统输出设备设置为 "BlackHole 2ch"。
- Linux: 使用内置的 PulseAudio/PipeWire Monitor Sink。脚本会自动处理切换。
- 安装依赖:
uv sync
- 环境测试:
验证窗口识别、OCR 以及录音功能:
PYTHONPATH=. uv run python src/tests/test_env.py PYTHONPATH=. uv run python src/tests/test_audio.py
- 启动助手:
PYTHONPATH=. uv run python main.py
- 找不到微信窗口: 请确保微信窗口处于打开状态且未被最小化。
- OCR 识别率: 如果微信界面是中文,请确保 Tesseract 已安装
chi_sim语言包。 - 录音无声音:
- Windows: 检查是否禁用了立体声混音(虽然 WASAPI 通常不需要)。
- macOS: 检查声音输出是否已手动切换到 BlackHole。
- Linux: 运行
pactl list short sources确认存在 monitor 设备。