mcpField
W
whisper

whisper

github.com/trpc-group创意与媒体1.9k50 次安装今天更新
代码仓库

关于 whisper

whisper 是使用 OpenAI Whisper 将音频文件转为文本的 skill,适合需要处理录音的用户。它支持多种音频格式、90 多种语言、时间戳以及文本或 JSON 输出。

主要功能

  1. 01转录多种音频格式
  2. 02自动检测 90 多种语言
  3. 03可选生成时间戳
  4. 04支持多种模型尺寸
  5. 05输出文本或 JSON

适用场景

  1. 01将录音转换为文字
  2. 02为转录内容添加时间戳
  3. 03生成 JSON 格式的转录结果

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/trpc-group/trpc-agent-go --skill whisper

安装后在 Claude Code 中输入/whisper确认已加载。

附带文件scripts/transcribe.py

详细介绍

Whisper 音频转录技能

使用 OpenAI Whisper 将音频文件转录为文本。

功能

  • 将音频文件(MP3、WAV、M4A、FLAC、OGG 等)转录为文本
  • 支持 90 多种语言并可自动检测
  • 可选生成时间戳
  • 支持多种模型大小(tiny/base/small/medium/large)
  • 支持纯文本或 JSON 格式输出

用法

基本转录
python3 scripts/transcribe.py <audio_file> <output_file>
使用选项
# Specify model size (default: base)
python3 scripts/transcribe.py audio.mp3 transcript.txt --model medium

# Specify language (improves accuracy)
python3 scripts/transcribe.py audio.mp3 transcript.txt --language zh

# Include timestamps
python3 scripts/transcribe.py audio.mp3 transcript.txt --timestamps

# JSON output with metadata
python3 scripts/transcribe.py audio.mp3 output.json --format json

参数

  • audio_file(必需):输入音频文件的路径
  • output_file(必需):输出文本/JSON 文件的路径
  • --model:Whisper 模型大小(tiny/base/small/medium/large,默认:base)
  • --language:语言代码(例如 en、zh、es、fr;自动检测请使用 auto)
  • --timestamps:在输出中包含词级时间戳
  • --format:输出格式(text/json,默认:text)

模型大小

模型参数量速度准确度内存
tiny39M~32x良好~1GB
base74M~16x更好~1GB
small244M~6x很好~2GB
medium769M~2x极佳~5GB
large1.5B1x最佳~10GB

支持的音频格式

MP3、WAV、M4A、FLAC、OGG、AAC、WMA 等(通过 FFmpeg 支持)

依赖项

  • Python 3.8+
  • openai-whisper
  • ffmpeg

安装

pip install openai-whisper
sudo apt-get install ffmpeg  # Ubuntu/Debian

评论

支持 Markdown