Communitygithub.com

Faster Whisper

基于 faster-whisper 的本地语音转文字工具,比 OpenAI Whisper 快 4-6 倍,精度相同;GPU 加速可达约 20 倍实时转录速度。支持标准和蒸馏模型,提供词级时间戳。

Faster Whisper 是什么?

Faster Whisper 是一个本地语音识别技能,使用 faster-whisper(CTranslate2 对 OpenAI Whisper 的重实现)进行语音到文本的转录。它比原始 Whisper 快 4-6 倍,在 GPU 加速下可实现约 20 倍实时速度(10 分钟音频文件约 30 秒)。该技能支持完整的 Whisper 模型和蒸馏模型,提供词级时间戳,并可在 Linux、macOS 和 Windows(包括 WSL2)上使用。它通过自动检测 GPU 并安装 CUDA 依赖项简化了设置,非常适合在需要离线处理、避免 API 成本的场景中转录音频/视频文件、生成字幕或进行多语言转录。

兼容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/sundial-org/awesome-openclaw-skills/tree/HEAD/skills/faster-whisper

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Faster Whisper 是做什么的?

基于 faster-whisper 的本地语音转文字工具——这是 OpenAI Whisper 的 CTranslate2 重实现,运行速度快 4-6 倍,精度相同。通过 GPU 加速,可实现约 20 倍实时转录(一个 10 分钟的音频文件约 30 秒)。

何时使用

在以下场景使用此技能:

  • 转录音/视频文件——会议、访谈、播客、讲座、YouTube 视频
  • 本地将语音转换为文本——无 API 成本,支持离线(模型下载后)
  • 批量处理多个音频文件——处理大量文件时高效
  • 生成字幕/标题——提供词级时间戳
  • 多语言转录——支持 99+ 种语言,自动检测

触发短语: "转录音频"、"语音转文字"、"他们说了什么"、"生成转录"、"音频转文本"、"给视频加字幕"

何时不使用:

  • 实时/流式转录(请使用针对流式优化的工具)
  • 无本地计算资源的纯云环境
  • 小于 10 秒的音频文件(API 调用延迟不重要)

快速参考

任务命令备注
基本转录./scripts/transcribe audio.mp3使用默认的 distil-large-v3
更快的英文./scripts/transcribe audio.mp3 --model distil-medium.en --language en仅英文,快 6.8 倍
最高精度./scripts/transcribe audio.mp3 --model large-v3-turbo --beam-size 10较慢但质量最佳
词时间戳./scripts/transcribe audio.mp3 --word-timestamps用于字幕/标题
JSON 输出./scripts/transcribe audio.mp3 --json -o output.json程序化访问
多语言./scripts/transcribe audio.mp3 --model large-v3-turbo自动检测语言
去除静音./scripts/transcribe audio.mp3 --vad语音活动检测

模型选择

根据需求选择合适的模型:

digraph model_selection {
    rankdir=LR;
    node [shape=box, style=rounded];

    start [label="开始", shape=doublecircle];
    need_accuracy [label="需要最高
精度?", shape=diamond];
    multilingual [label="多语言
内容?", shape=diamond];
    resource_constrained [label="资源
受限?", shape=diamond];

    large_v3 [label="large-v3
或
large-v3-turbo", style="rounded,filled", fillcolor=lightblue];
    large_turbo [label="large-v3-turbo", style="rounded,filled", fillcolor=lightblue];
    distil_large [label="distil-large-v3
(默认)", style="rounded,filled", fillcolor=lightgreen];
    distil_medium [label="distil-medium.en", style="rounded,filled", fillcolor=lightyellow];
    distil_small [label="distil-small.en", style="rounded,filled", fillcolor=lightyellow];

    start -> need_accuracy;
    need_accuracy -> large_v3 [label="是"];
    need_accuracy -> multilingual [label="否"];
    multilingual -> large_turbo [label="是"];
    multilingual -> resource_constrained [label="否(英文)"];
    resource_constrained -> distil_small [label="移动/边缘设备"];
    resource_constrained -> distil_medium [label="部分受限"];
    resource_constrained -> distil_large [label="否"];
}

模型表格

标准模型(完整 Whisper)

模型大小速度精度用例
tiny / tiny.en39M最快基础快速草稿
base / base.en74M非常快良好一般使用
small / small.en244M快较好多数任务
medium / medium.en769M中等高高质量转录
large-v1/v2/v31.5GB较慢最佳最高精度
large-v3-turbo809M快优秀精度优先推荐

蒸馏模型(约快 6 倍,WER 差异约 1%)

模型大小相对于标准模型的速度精度用例
distil-large-v3756M约快 6.3 倍9.7% WER默认,最佳平衡
distil-large-v2756M约快 5.8 倍10.1% WER后备方案
distil-medium.en394M约快 6.8 倍11.1% WER仅英文,资源受限
distil-small.en166M约快 5.6 倍12.1% WER移动/边缘设备

.en 模型仅支持英文,对于英文内容稍快且表现更好。

安装

Linux / macOS / WSL2

# 运行安装脚本(创建 venv,安装依赖,自动检测 GPU)
./setup.sh

Windows(原生)

# 从 PowerShell 运行(通过 winget 自动安装 Python 和 ffmpeg)
.\setup.ps1

Windows 安装脚本会:

  • 如果找不到 Python 3.12,通过 winget 自动安装
  • 如果找不到 ffmpeg,通过 winget 自动安装
  • 检测 NVIDIA GPU 并安装支持 CUDA 的 PyTorch
  • 创建 venv 并安装所有依赖

要求:

  • Linux/macOS/WSL2:Python 3.10+,ffmpeg
  • Windows:无需任何预装!安装脚本会通过 winget 自动安装依赖

平台支持

平台加速速度自动安装
Windows + NVIDIA GPUCUDA约 20 倍实时 🚀✅ 完整
Linux + NVIDIA GPUCUDA约 20 倍实时 🚀手动安装依赖
WSL2 + NVIDIA GPUCUDA约 20 倍实时 🚀手动安装依赖
macOS Apple SiliconCPU*约 3-5 倍实时手动安装依赖
macOS IntelCPU约 1-2 倍实时手动安装依赖
Windows(无 GPU)CPU约 1 倍实时✅ 完整
Linux(无 GPU)CPU约 1 倍实时手动安装依赖
  • faster-whisper 在 macOS 上使用 CTranslate2 仅支持 CPU,但 Apple Silicon 足以满足实际使用。

GPU 支持(重要!)

安装脚本会自动检测你的 GPU 并安装带 CUDA 的 PyTorch。请务必使用 GPU(如果可用)——CPU 转录极其缓慢。

硬件速度9 分钟视频
RTX 3070(GPU)约 20 倍实时约 27 秒
CPU(int8)约 0.3 倍实时约 30 分钟

如果安装脚本未能检测到你的 GPU,请手动安装带 CUDA 的 PyTorch:

Linux/macOS/WSL2:

# 对于 CUDA 12.x
uv pip install --python .venv/bin/python torch --index-url https://download.pytorch.org/whl/cu121

# 对于 CUDA 11.x
uv pip install --python .venv/bin/python torch --index-url https://download.pytorch.org/whl/cu118

Windows:

# 对于 CUDA 12.x
.venv\Scripts\pip install torch --index-url https://download.pytorch.org/whl/cu121

# 对于 CUDA 11.x
.venv\Scripts\pip install torch --index-url https://download.pytorch.org/whl/cu118

使用方法

Linux/macOS/WSL2:

# 基本转录
./scripts/transcribe audio.mp3

# 指定模型
./scripts/transcribe audio.wav --model large-v3-turbo

# 带词时间戳
./scripts/transcribe audio.mp3 --word-timestamps

# 指定语言(比自动检测更快)
./scripts/transcribe audio.mp3 --language en

# JSON 输出
./scripts/transcribe audio.mp3 --json

Windows(cmd 或 PowerShell):

# 基本转录
.\scripts\transcribe.cmd audio.mp3

# 指定模型
.\scripts\transcribe.cmd audio.wav --model large-v3-turbo

# 带词时间戳(PowerShell 原生语法也可用)
.\scripts\transcribe.ps1 audio.mp3 -WordTimestamps

# JSON 输出
.\scripts\transcribe.cmd audio.mp3 --json

选项

--model, -m        模型名称(默认:distil-large-v3)
--language, -l     语言代码(例如 en, es, fr——省略则自动检测)
--word-timestamps  包含词级时间戳
--beam-size        束搜索大小(默认:5,越大越精确但也越慢)
--vad              启用语音活动检测(去除静音)
--json, -j         输出为 JSON
--output, -o       将转录保存到文件
--device           cpu 或 cuda(自动检测)
--compute-type     int8, float16, float32(默认:自动优化)
--quiet, -q        压制进度消息

示例

# 转录音频(用 yt-dlp 提取后)
yt-dlp -x --audio-format mp3 <URL> -o audio.mp3
./scripts/transcribe audio.mp3

# 批量转录并输出 JSON
for file in *.mp3; do
  ./scripts/transcribe "$file" --json > "${file%.mp3}.json"
done

# 高精度转录,使用更大的束搜索大小
./scripts/transcribe audio.mp3 \
  --model large-v3-turbo --beam-size 10 --word-timestamps

# 快速英文转录
./scripts/transcribe audio.mp3 \
  --model distil-medium.en --language en

# 使用 VAD 转录(去除静音)
./scripts/transcribe audio.mp3 --vad

常见错误

错误问题解决办法
GPU 可用时仍使用 CPU慢 10-20 倍在 Windows/Linux 上检查 nvidia-smi;验证 CUDA 安装
未指定语言对已知内容浪费自动检测时间知道语言时使用 --language en
使用错误模型不必要的缓慢或精度差默认 distil-large-v3 很优秀;仅当精度有问题时再用 large-v3
忽略蒸馏模型错过了 6 倍加速,精度损失 <1%尝试 distil-large-v3 再考虑标准模型
忘记安装 ffmpeg安装失败或音频无法处理安装脚本会自动处理;手动安装时需要单独安装 ffmpeg
内存不足错误模型太大,超出可用 VRAM/RAM使用更小的模型或 --compute-type int8
过度优化束搜索大小超过 5-7 后收益递减默认的 5 就够了;关键转录时尝试 10

性能说明

  • 首次运行:下载模型到 ~/.cache/huggingface/(一次性)
  • GPU:如果可用,自动使用 CUDA(快约 10-20 倍)
  • 量化:在 CPU 上使用 INT8 实现约 4 倍加速,精度损失极小
  • 内存:
    • distil-large-v3:约 2GB RAM / 约 1GB VRAM
    • large-v3-turbo:约 4GB RAM / 约 2GB VRAM
    • tiny/base:<1GB RAM

为什么选择 faster-whisper?

  • 速度:比 OpenAI 的原始 Whisper 快约 4-6 倍
  • 精度:相同(使用相同模型权重)
  • 效率:通过量化降低内存使用
  • 生产就绪:稳定的 C++ 后端(CTranslate2)
  • 蒸馏模型:快约 6 倍,精度损失 <1%

故障排除

“CUDA 不可用——使用 CPU”:安装带 CUDA 的 PyTorch(参见上方 GPU 支持) 安装失败:确保已安装 Python 3.10+ 内存不足:使用更小的模型或 --compute-type int8 在 CPU 上缓慢:预期行为——使用 GPU 进行实际转录 模型下载失败:检查 ~/.cache/huggingface/ 权限(Linux/macOS)或 %USERPROFILE%\.cache\huggingface\(Windows)

Windows 特定问题

“找不到 winget”:从 Microsoft Store 安装 App Installer,或手动安装 Python/ffmpeg “安装后 Python 不在 PATH 中”:关闭并重新打开终端,然后再次运行 setup.ps1 PowerShell 执行策略错误:运行 Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned 或改用 transcribe.cmd 找不到 nvidia-smi 但有 GPU:安装 NVIDIA 驱动程序——Game Ready 或 Studio 驱动程序包含 nvidia-smi

参考

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

sundial-org/awesome-openclaw-skills

Complete X (Twitter) algorithm mastery - engagement weights, viral formulas, shadow ban avoidance, thread optimization, and growth strategies. Based on X's open-source code analysis and real creator data.

sundial-org/awesome-openclaw-skills

Create product demo videos by automating browser interactions and capturing frames. Use when the user wants to record a demo, walkthrough, product showcase, or interactive video of a web application. Supports Playwright CDP screencast for high-quality capture and FFmpeg for video encoding.

sundial-org/awesome-openclaw-skills

Text-to-speech conversion using node-edge-tts npm package for generating audio from text. Supports multiple voices, languages, speed adjustment, pitch control, and subtitle generation. Use when: (1) User requests audio/voice output with the "tts" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, accessibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or format for TTS output.

sundial-org/awesome-openclaw-skills

Comprehensive video/audio processing with FFmpeg. Use for: (1) Video transcoding and format conversion, (2) Cutting and merging clips, (3) Audio extraction and manipulation, (4) Thumbnail and GIF generation, (5) Resolution scaling and quality adjustment, (6) Adding subtitles or watermarks, (7) Speed adjustment (slow/fast motion), (8) Color correction and filters.

sundial-org/awesome-openclaw-skills

Generate FFmpeg commands from natural language video editing requests - cut, trim, convert, compress, change aspect ratio, extract audio, and more.

sundial-org/awesome-openclaw-skills

Create a verbatim transcript for a YouTube URL using Google Gemini (speaker labels, paragraph breaks; no time codes). Use when the user asks to transcribe a YouTube video or wants a clean transcript (no timestamps).

sundial-org/awesome-openclaw-skills

Generate landing page code from product descriptions

sundial-org/awesome-openclaw-skills

Generate a beautiful HTML landing page from your package.json. Use when you need a quick marketing page for your project.

sundial-org/awesome-openclaw-skills

Founder vs employee personal branding strategies with LinkedIn positioning and exit planning

sundial-org/awesome-openclaw-skills

Monitor stock/crypto holdings, get price alerts, track portfolio performance

sundial-org/awesome-openclaw-skills

End-to-end AI video generation - create videos from text prompts using image generation, video synthesis, voice-over, and editing. Supports OpenAI DALL-E, Replicate models, LumaAI, Runway, and FFmpeg editing.

sundial-org/exa-web-search-free

Free AI search via Exa MCP. Web search for news/info, code search for docs/examples from GitHub/StackOverflow, company research for business intel. No API key needed.

sundial-org/finance-news

Market news briefings with AI summaries. Use when asked about stock news, market updates, portfolio performance, morning/evening briefings, financial headlines, or price alerts. Supports US/Europe/Japan markets, WhatsApp delivery, and English/German output.

sundial-org/jina-reader

Web content extraction via Jina AI Reader API. Three modes: read (URL to markdown), search (web search + full content), ground (fact-checking). Extracts clean content without exposing server IP.

sundial-org/memory-setup

Enable and configure Moltbot/Clawdbot memory search for persistent context. Use when setting up memory, fixing "goldfish brain," or helping users configure memorySearch in their config. Covers MEMORY.md, daily logs, and vector search setup.

sundial-org/news-summary

This skill should be used when the user asks for news updates, daily briefings, or what's happening in the world. Fetches news from trusted international RSS feeds and can create voice summaries.

sundial-org/ontology

Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.

sundial-org/remind-me

Set reminders using natural language. Automatically creates one-time cron jobs and logs to markdown.

sundial-org/stock-market-pro

Professional stock price tracking, fundamental analysis, and financial reporting tool. Supports global markets (US, KR, etc.), Crypto, and Forex with real-time data. (1) Real-time quotes, (2) Valuation metrics (PE, EPS, ROE), (3) Earnings calendar and consensus, (4) High-quality Candlestick & Line charts with technical indicators (MA5/20/60).

相关技能