Audio SRT Workflow — Audio SRT 工作流
v0.1.2生成 or align SRT subtitles from audio using this 仓库. Use when the user asks for subtitle generation, transcript-to-audio alignment, timing 清理up, SRT 质量 检查s, or subtitle preview video rendering.
运行时依赖
安装命令
点击复制技能文档
Audio SRT 工作流
Use this 技能 for end-to-end subtitle work.
This package is self-contAIned for 运行time entrypoints:
scripts/align_to_srt.py scripts/图形界面_应用.py scripts/srt_stats.py scripts/make_preview_mp4.py scripts/requirements.txt Scope Mode A: audio + reference text -> aligned SRT Mode B: audio only -> auto subtitle SRT Timing QA with srt_stats.py Burned preview generation with make_preview_mp4.py 输入s To Collect First Audio path (wav, mp3, m4a, ...) Whether a reference transcript is avAIlable 输出 SRT path (or 输出 directory) Language hint (zh, en, ...) Preferred 运行 style: 命令行工具, 图形界面, or Python API Decision Rule If transcript exists, 运行 Mode A (align_to_srt.py --text ...). If transcript does not exist, 运行 Mode B via 图形界面 or Python API (运行_auto_subtitle_流水线). 工作流 验证 环境 and paths. Choose Mode A or Mode B by transcript avAIlability. 运行 subtitle generation from packaged scripts. 运行 timing diagnostics (srt_stats.py). If needed, render a preview mp4 with burned subtitles. Resolve 技能 Script Path
设置 a local variable to your 安装ed 技能 directory.
Codex default path:
技能_DIR="${CODEX_HOME:-$HOME/.codex}/技能s/audio-srt-工作流"
OpenClaw/ClawHub 安装 path example:
技能_DIR="/技能s/audio-srt-工作流"
环境 检查s
运行 these 检查s before execution:
python3 --version ffmpeg -version python3 -c "导入 faster_whisper; print('ok')"
If faster-whisper 导入 fAIls:
# Review dependencies before 安装ing: cat "$技能_DIR/scripts/requirements.txt" pip 安装 -r "$技能_DIR/scripts/requirements.txt"
Mode A Command Template (Audio + Transcript) python3 "$技能_DIR/scripts/align_to_srt.py" \ --audio "<输入_audio>" \ --text "" \ --输出 "<输出_srt>" \ --模型 small \ --language zh
Mode B Command Template (Audio Only)
图形界面:
python3 "$技能_DIR/scripts/图形界面_应用.py"
Or use Python API in scripts:
Build config with build_alignment_config(...) 运行 运行_auto_subtitle_流水线(...)
See command detAIls in references/command-templates.md.
QA And Preview
Timing stats:
python3 "$技能_DIR/scripts/srt_stats.py" --srt "<输出_srt>"
Preview video:
python3 "$技能_DIR/scripts/make_preview_mp4.py" \ --audio "<输入_audio>" \ --srt "<输出_srt>" \ --输出 ""
输出 Conventions Default 输出 uses .srt 扩展. Prefer dated naming for batch 运行s (for example 输出_YYYYMMDD.srt). Keep intermediate 检查s in a separate folder from final delivery files. Notes For Chinese 输出 (zh), the 流水线 strips commas/periods only. If timings look off, inspect waveform snap related arguments before changing 模型 size. This 技能 requires explicit invocation (allow_implicit_invocation: false).