Files
SFX-Library-Automation/README.md
2025-11-20 14:28:23 +08:00

38 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SFX-Library-Automation 🎧
**基于 Ollama 本地大模型与 Python 的音效库整理工具集:自动汉化文件名、目录名,及多线程压缩瘦身。**
## ✨ 功能特性 (Features)
这是我为了整理几百 GB 英文音效库而编写的三个 Python 脚本旨在解决“英文文件名难检索”和“WAV文件占用空间大”的痛点。
1. **🤖 智能汉化文件名 (`translate_sfx.py`)**
* 使用本地 Ollama API (推荐 Gemma/Llama3) 进行翻译。
* 理解音效术语 (如 `Whoosh` -> `嗖嗖声`, `Impact` -> `撞击`)。
* **格式**`【中文翻译】原始英文名.wav`,保留原文以便对照。
* 支持断点续传(跳过已汉化文件)。
2. **📂 智能汉化文件夹 (`translate_folders.py`)**
* 采用 Bottom-Up (倒序) 逻辑,安全处理多层级嵌套目录。
* 智能识别并跳过已包含中文的目录,保护根目录结构。
3. **⚡ 多线程音频压缩 (`wav_to_mp3.py`)**
* 利用 `concurrent.futures` 跑满 CPU 核心。
* 实测 16 线程下,处理 500+ 文件仅需 20多秒。
* 推荐 **320kbps MP3**,在缩减 75% 体积的同时保留高频细节。
* **安全模式**:只有在 MP3 生成且校验成功后,才询问是否删除原 WAV。
## 🚀 快速开始 (Quick Start)
### 依赖
* Python 3.x
* `pip install requests`
* [Ollama](https://ollama.com/) (运行中, 默认端口 11434)
* [FFmpeg](https://ffmpeg.org/) (需添加到环境变量或放置在脚本同级目录)
### 使用
1. 启动 Ollama: `ollama run gemma3:12b` (或其他模型)
2. 运行脚本: `python translate_sfx.py`
3. 拖入文件夹路径,按提示操作即可。建议先选择 **模式1 (模拟/Dry Run)** 查看效果。
---
*Made with ❤️ for Sound Designers & Editors.*