Auto-Whisper Safe:节省内存的音频转录 - Openclaw Skills

作者:互联网

2026-04-14

AI教程

什么是 Auto-Whisper Safe?

Auto-Whisper Safe 是一款专门设计的实用工具,旨在为资源受限的环境提供可靠的语音转文字功能。虽然标准的 Whisper 实现通常会在 16GB 内存系统上导致内存溢出 (OOM) 错误,但此技能引入了内存安全的工作流程,在不牺牲准确性的前提下优先保证稳定性。对于正在构建强大 Openclaw Skills 且需要在处理长音频文件的同时运行其他高强度后台进程的开发者来说,这是一个关键的补充。

通过利用智能音频长度检测和自动 10 分钟段切分,该技能确保内存使用量始终保持在较低水平,在使用默认 base 模型时,峰值通常仅为 1.5GB。无论您是在转录 T@elegrimm 语音备忘录还是长达一小时的播客,此工具都能提供无缝、无间隙的输出,并直接集成到您的智能体工作流中。

下载入口:https://github.com/openclaw/skills/tree/main/skills/neal-collab/auto-whisper-safe

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install auto-whisper-safe

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 auto-whisper-safe。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Auto-Whisper Safe 应用场景

  • 在不导致宿主机崩溃的情况下转录长篇播客或采访。
  • 为 AI 智能体实时处理 OGG、MP3 或 WAV 格式的传入语音消息。
  • 在 16GB 内存硬件上运行高精度转录,同时保持其他 Openclaw Skills 处于活动状态。
  • 通过分段音频处理实现会议录音的自动化文档化。
Auto-Whisper Safe 工作原理
  1. 该技能利用 ffprobe 分析输入音频文件并检测其总时长。
  2. 如果音频超过 10 分钟,系统会自动触发 ffmpeg 将文件分割成更小的段。
  3. 每个分段使用指定的 Whisper 模型独立处理,将内存占用控制在 1.5GB 的安全限制内。
  4. 生成的文本段被合并为一个完整、连贯的转录文本,没有重叠或缺失内容。
  5. 完成后自动删除所有临时音频分段和中间数据文件,以节省磁盘空间。

Auto-Whisper Safe 配置指南

要将此功能添加到您的 Openclaw Skills 库中,请确保已安装必要的系统依赖:

# macOS 用户
brew install openai-whisper ffmpeg

# Ubuntu/Debian 用户
pip install openai-whisper
apt install ffmpeg

要转录文件,请从终端运行脚本:

./transcribe.sh /path/to/audio.mp3

Auto-Whisper Safe 数据架构与分类体系

该技能通过以下数据结构管理音频处理:

属性 详情
支持的输入格式 .ogg, .mp3, .m4a, .wav, .flac, .webm, .opus
默认模型 base (~1.5GB 内存占用)
输出类型 包含完整转录内容的纯文本文件 (.txt)
配置变量 WHISPER_MODEL (tiny 到 large), WHISPER_LANG (ISO 语言代码)
清理策略 转录后立即删除临时 .wav 分段
name: auto-whisper-safe
version: 1.0.0
description: RAM-safe voice transcription with auto-chunking — works on 16GB machines without crashes
emoji: ???
tags:
  - whisper
  - transcription
  - voice
  - audio
  - ram-safe
requires:
  bins:
    - whisper
    - ffmpeg

Auto-Whisper Safe — RAM-Friendly Voice Transcription

Transcribe voice messages and long audio files using OpenAI Whisper without crashing your machine. Designed for 16GB RAM systems running other processes (like OpenClaw agents).

The Problem

Whisper's turbo and large models use 6-10GB RAM. On a 16GB machine running OpenClaw + Ollama + other services, this causes OOM crashes. Existing Whisper skills don't handle this.

The Solution

  1. Auto-detects audio length via ffprobe
  2. Splits long audio (>10min) into 10-min chunks automatically
  3. Uses base model by default (~1.5GB RAM — safe on any 16GB machine)
  4. Merges transcripts seamlessly — no gaps, no duplicates
  5. Cleans up temp files automatically

Usage

# Basic usage
./transcribe.sh /path/to/audio.ogg

# Custom model (if you have more RAM)
WHISPER_MODEL=small ./transcribe.sh /path/to/audio.ogg

# Custom language
WHISPER_LANG=en ./transcribe.sh /path/to/audio.ogg

# Custom output directory
./transcribe.sh /path/to/audio.ogg /path/to/output/

RAM Usage by Model

Model RAM Speed Accuracy Recommended For
tiny ~1GB ??? ★★ Quick previews, low-RAM systems
base ~1.5GB ?? ★★★ Default — best balance ?
small ~2.5GB ? ★★★★ When accuracy matters more
medium ~5GB ?? ★★★★★ 32GB+ RAM only
turbo ~6GB ???? ★★★★★ Dedicated transcription machines

OpenClaw Integration

Add to your agent's BOOTSTRAP.md:

## Voice Message Handling

When you receive ``, ALWAYS transcribe first:

1. Run: `./skills/auto-whisper-safe/transcribe.sh `
2. Read the output transcript file
3. Respond based on the transcribed content

Do this automatically — voice messages are meant to be transcribed.

Environment Variables

Variable Default Description
WHISPER_MODEL base Whisper model size
WHISPER_LANG en Audio language (ISO code)

How Chunking Works

  • Audio ≤10min → transcribed directly (no splitting)
  • Audio >10min → split into 10-min segments via ffmpeg
  • Each segment transcribed independently
  • Transcripts concatenated in order
  • Temp files cleaned up on exit (even on errors)

Installation

# macOS
brew install openai-whisper ffmpeg

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

# Verify
whisper --help && ffmpeg -version

Why This Over Other Whisper Skills

  • ? RAM-safe: Won't crash your 16GB machine
  • ? Auto-chunking: Handles 1-hour podcasts without issues
  • ? Cleanup: No temp files left behind
  • ? Progress: Shows chunk-by-chunk progress
  • ? Configurable: Model + language via env vars
  • ? OpenClaw-native: Drop-in for any agent's BOOTSTRAP.md

Real-World Performance

Tested on Ubuntu 22.04, 16GB RAM, running OpenClaw (10 agents) + Ollama simultaneously:

Audio Length Model RAM Peak Time Result
2 min voice memo base 1.4GB ~15s ? Perfect
12 min podcast clip base 1.5GB (chunked) ~90s ? 2 chunks, seamless
45 min interview base 1.5GB (chunked) ~6min ? 5 chunks, seamless
2 min voice memo tiny 0.9GB ~8s ? Good enough for quick reads

Supported Audio Formats

ffmpeg handles the conversion, so virtually any format works:

  • ? .ogg (T@elegrimm voice messages)
  • ? .mp3, .m4a, .wav, .flac
  • ? .webm (browser recordings)
  • ? .opus (WhatsApp voice messages)

Changelog

v1.0.0

  • Initial release
  • Auto-chunking for long audio (>10min)
  • RAM-safe defaults (base model, 1.5GB)
  • Progress tracking per chunk
  • Automatic temp file cleanup
  • Configurable model and language