Skip to content

shuolsure/FunASR-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

FunASR 批量转录技能

使用 FunASR (SenseVoice) 批量转录音频文件的 Claude Code Skill。

功能特性

  • 并行转录(可配置进程数)
  • 断点续传(跳过已完成文件)
  • 失败重试(记录失败文件)
  • 支持格式:m4a、mp3、wav、flac、aac
  • 输出格式:每个音频生成 .txt + .json

安装

1. 安装依赖

pip install funasr modelscope

2. 下载模型

首次运行会自动下载模型到 ~/.cache/modelscope/,或手动下载:

from modelscope import snapshot_download
snapshot_download('iic/SenseVoiceSmall')
snapshot_download('iic/speech_fsmn_vad_zh-cn-16k-common-pytorch')

3. 安装 Skill

将此仓库克隆到你的 skills 目录:

# Claude Code
git clone https://github.com/shuolsure/FunASR-skill.git ~/.claude/skills/funasr-batch-transcribe

# 或 iFlow CLI
git clone https://github.com/shuolsure/FunASR-skill.git ~/.iflow/skills/funasr-batch-transcribe

使用方法

在 Claude Code 或 iFlow CLI 中,使用以下触发词:

  • 批量转录
  • 音频转文字
  • 语音识别
  • FunASR
  • ASR
  • 转录音频目录

命令行直接使用

python3 ~/.iflow/skills/funasr-batch-transcribe/scripts/batch_transcribe.py \
  /path/to/audio -o /path/to/output -j 4

参数说明

参数 说明 默认值
input_dir 音频文件目录(必需) -
-o, --output 输出目录 ~/transcripts
-j, --jobs 并行进程数 1
--retry 重试失败文件 -

输出文件

每个音频生成两个文件:

  • .txt - 纯文本转录结果
  • .json - 结构化数据(文件路径、文本、耗时)

辅助文件:

  • .progress.json - 进度记录
  • failed_files.txt - 失败列表

示例

# 基本使用
python3 batch_transcribe.py ./recordings -o ./transcripts -j 2

# 重试失败的文件
python3 batch_transcribe.py ./recordings -o ./transcripts --retry

技术细节

  • 模型:SenseVoiceSmall + VAD
  • 并行:Python multiprocessing
  • RTF:约 0.1-0.3(取决于硬件)

License

Apache 2.0

About

FunASR 批量音频转录技能 - 支持 FunASR (SenseVoice) 批量转录音频文件,并行处理、断点续传、失败重试

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages