audio-to-docx

Transcribes audio files (m4a, mp3, wav, flac, ogg, etc.) locally into a Simplified Chinese Word document (.docx), producing a document with a header, body paragraphs, and a per-sentence timestamp appendix. Use when users request actions like “convert recording to Word”, “speech-to-text document”, “organize recording into transcript”, “transcribe meeting audio”, or “audio/m4a/mp3 to docx”. Based on faster-whisper local CPU inference; audio remains on the machine and no API key is required.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "audio-to-docx" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c23fe0711d4906b9b5a7b9f340a443b435e099136f87ec6cfd6f6b9d45bb8b8c. Verify the upstream source and version against https://skillhub.cn/skills/user_b5009730/audio-to-docx before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Transcribes audio files (m4a, mp3, wav, flac, ogg, etc.) locally into a Simplified Chinese Word document (.docx), producing a document with a header, body paragraphs, and a per-sentence timestamp appendix. Use when users request actions like “convert recording to Word”, “speech-to-text document”, “organize recording into transcript”, “transcribe meeting audio”, or “audio/m4a/mp3 to docx”. Based on faster-whisper local CPU inference; audio remains on the machine and no API key is required.

0 Downloads

Introduction source: third_party · user_b5009730 · 1.0.2 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: audio-to-docx
description: 将录音/音频文件(m4a、mp3、wav、flac、ogg 等)在本地转写为简体中文 Word 文档(.docx),含信息头、正文段落和逐句时间戳附录。当用户要求"把录音转成 Word 文档""语音转文字文档""录音整理成文稿""转录会议录音""audio/m4a/mp3 转 docx"时使用。基于 faster-whisper 本地 CPU 推理,录音内容不出本机,无需 API key。
agent_created: true

audio-to-docx — 录音本地转写为 Word 文档

Overview

使用 faster-whisper 在本机 CPU 上把音频文件转写为简体中文 Word 文档(.docx)。文档包含:会议信息头(源文件/时长/语言/模型/片段数)、"一、转录正文"(按停顿合并的自然段落)、"二、逐句时间戳转录"(带 [HH:MM:SS] 时间戳)。全程本地处理,录音内容不离开本机。

何时使用

  • 用户给出录音文件路径,要求转成 Word 文档/文稿/纪要底稿。
  • 触发词:"录音转 word""语音转文档""转录录音""会议录音整理""audio to docx""m4a/mp3/wav 转 word"。

前置条件(首次运行先检查)

任一 Python 3.9+ 环境(WorkBuddy 托管 Python、系统 Python 或自建 venv 均可,建议用隔离环境避免污染系统 Python),安装三个包:

pip install faster-whisper python-docx opencc-python-reimplemented

脚本已内置以下处理,不要在调用时再手动补:

  • HF 模型下载默认走 https://hf-mirror.com 镜像并禁用 xet(国内网络更稳;若你的网络可直连 huggingface.co,用环境变量 HF_ENDPOINT 覆盖即可,脚本不会强改已有值)。
  • 音频自动复制为 ASCII 临时名(规避中文路径下原生工具 Illegal byte sequence)。
  • 默认 CPU + int8 推理,任何机器都能跑;有 CUDA 环境的机器可用 --device cuda --compute-type int8_float16 加速(需已装 CUDA 运行库,如 cublas64_12.dll)。
  • 适用环境:面向中文录音场景优化(自动繁转简、Word 中文字体);Windows 验证通过,其他桌面平台可运行但 Word 字体会自动回退替代。

用法

脚本:scripts/audio_to_docx.py(用 Skill 目录下的绝对路径调用)。

# 最短用法:输出到音频同目录 <文件名>_转录.docx
python <skill_dir>/scripts/audio_to_docx.py "C:\path\to\录音.m4a"

# 自定义输出/模型/语言
python <skill_dir>/scripts/audio_to_docx.py "录音.m4a" --out "输出.docx" --model small --language zh

# 有 CUDA 环境的机器用 GPU 加速
python <skill_dir>/scripts/audio_to_docx.py "录音.m4a" --device cuda --compute-type int8_float16

# 仅重建文档(转写 JSON 已存在但 docx 缺失/需重新排版时)
python <skill_dir>/scripts/audio_to_docx.py "录音.m4a" --build-only

退出码:0 成功;2 依赖缺失;3 输入/转写失败;4 文档生成失败。成功后日志最后一行为 DONE。

耗时与后台运行(重要)

  • medium 模型在普通 CPU 约 1.2~2× 实时:长录音(>30 分钟)可能耗时数小时(中等配置 Windows CPU 实测 102 分钟录音约 2 小时 46 分;赶时间可换 --model small)。
  • 长录音务必用 run_in_background 后台启动,日志重定向到临时文件,并告知用户大致时长。
  • 后台进程的 TaskOutput 句柄会过期(报 "task not found" 属正常)。判断存活用 tasklist | grep python 和日志文件 mtime,不要依赖句柄。
  • 完成判定:日志出现 DONE 且目标 .docx 存在。沙箱偶发"报告成功但文件未落盘"——交付前务必再 ls 确认;缺失则用 --build-only 重建。

已知坑(勿再踩)

  1. Whisper 中文输出偏繁体:脚本已用 OpenCC "t2s" 统一转简体,正文和附录都转。
  2. 段落合并策略:相邻片段停顿 ≥1.2s 或当前段落 ≥200 字即分段。
  3. python-docx 中文需同时设 font.name 和 rPr.rFonts 的 w:eastAsia,脚本已处理。
  4. 模型首次运行需联网下载到本地缓存(medium 约 1.5GB);已走镜像。small 更快但精度略低,large-v3 更准但慢数倍。
  5. 识别稿对专业术语、同音字、多人交叠说话可能有误差;交付时提醒用户核对关键内容。

交付

  • 默认输出:音频同目录 <文件名>_转录.docx(用户要保留的文件放工作区目录,不要留在 temp)。
  • 中间缓存(JSON)在系统 temp 目录(a2d_<hash>_*.json),便于 --build-only 恢复。
  • 用 present_files 把生成的 .docx 交给用户。

Current listing version

1.0.2

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value80/100

Highlights

  • 解决用户将录音转写为结构化 Word 文档的实际需求,适用于会议纪要、访谈整理等高频场景
  • 全程本地处理保障隐私,无需 API key,具备广泛实用价值
Trigger Precision85/100

Highlights

  • 触发词覆盖全面,包括中英文常见表达,边界清晰不易误触
Structure and Standards90/100

Areas to improve

  • 缺少 When to Use 显式章节标题 Reported severity: Minor

    文档中实际有触发场景说明,但未使用标准章节标题命名

    Recommendation: 建议将'何时使用'改为标准标题'When to Use'以保持规范统一

  • 文档内容较长 Reported severity: Minor

    详细说明虽完整但篇幅偏长,可能影响快速查阅

    Recommendation: 可考虑将部分技术细节折叠或移至附录

Highlights

  • 结构完整,包含前置条件、用法、耗时说明、已知坑和交付指引
  • 提供多种调用示例和参数说明,执行路径清晰
Execution Reliability90/100

Highlights

  • 依赖包明确,提供完整安装命令
  • 涵盖异常处理机制(退出码定义)、后台运行建议和文件确认机制
  • 详细说明模型选择、硬件加速选项和网络镜像配置
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 23
  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 3
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • hf-mirror.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.