Apple Silicon 本地语音转文字引擎
简介
基于 Apple MLX 框架的本地化 Whisper 语音转录方案,专为 M 系列芯片优化,无需 API 密钥、完全离线运行,速度提升 60 倍。
原始描述
Set up mlx-whisper as the local audio transcription engine for OpenClaw on Apple Silicon Macs (M1/M2/M3/M4). Automatically transcribes voice notes sent via T...
通过你的 Agent 添加
安装目录:mlx-whisper-162369/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
mlx-whisper 是专为 Apple Silicon(M1/M2/M3/M4)设计的本地语音转录技能,为 OpenClaw 提供零依赖、零费用的语音消息处理能力。用户通过 Telegram 或 WhatsApp 发送语音消息后,系统自动下载音频文件(.ogg 或 .opus 格式),调用本地 mlx-whisper-transcribe.sh 脚本完成转录,并将文本内容注入对话流程供 Agent 处理。
部署流程包含三步:通过 pip 安装 mlx-whisper 包、将封装脚本复制到 Python 用户目录并赋予执行权限,最后在 ~/.openclaw/openclaw.json 中配置音频处理工具链。首次运行需联网下载约 465MB 的 whisper-small-mlx 模型,后续完全离线可用。
显著优点
极致性能优化:依托 Apple MLX 机器学习框架,转录速度较标准 Whisper 提升约 60 倍。实测 M3 MacBook Pro 处理 1 分钟音频仅需 7 秒,30 分钟音频约 3.5 分钟完成。
零成本隐私保障:无需 OpenAI、Google 等第三方 API 密钥,语音数据全程本地处理,彻底消除云端传输的隐私泄露风险,适合对数据主权敏感的个人与企业场景。
灵活模型配置:提供 tiny(75MB)到 large-v3(3GB)四档模型,可在速度与精度间按需取舍,并支持语言代码强制指定以跳过自动检测、进一步加速。
潜在缺点与局限性
硬件门槛严格:仅支持 macOS Darwin 系统的 Apple Silicon 设备,Intel Mac 及 Windows/Linux 平台完全无法运行,生态封闭性显著。
初始部署复杂度:需用户手动完成 Python 环境验证、脚本路径配置、JSON 工具链注册等多步操作,对非技术用户存在门槛。
功能边界明确:Whisper 模型本质为语音转文字,无法识别音乐内容,对极低信噪比、浓重口音或专业术语的转录准确率会下降。
适合的目标群体
- Apple Silicon 重度用户:已深度使用 Mac 生态、追求本地优先(Local-First)工作流的效率极客
- 隐私敏感型团队:律师、医疗、金融等合规要求严苛行业,需确保语音数据不出本地设备
- 高频语音沟通者:习惯通过 Telegram/WhatsApp 发送语音消息、希望自动归档为可搜索文本的知识工作者
- 低预算开发者:不愿承担云端 API 持续调用的 Token 成本,接受一次性硬件投入的独立开发者
使用风险
依赖管理风险:技能依赖 python3、pip3 及特定版本的 mlx-whisper 包,系统 Python 环境冲突或 MLX 框架更新可能导致功能失效。
存储与缓存占用:模型首次下载需约 465MB 流量与本地存储,多模型共存时缓存可达数 GB,长期运行需关注 ~/.cache/huggingface 目录膨胀。
超时与容错:默认 60 秒超时限制可能无法覆盖超长音频(如 1 小时以上会议录音),需手动调整配置;网络异常仅影响首次模型下载,但无优雅降级方案。
维护可持续性:作为社区驱动技能,后续兼容性依赖 OpenClaw 与 mlx-whisper 上游项目的同步更新,长期稳定性需持续验证。
技能正文
name: mlx-whisper
description: >
Set up mlx-whisper as the local audio transcription engine for OpenClaw on Apple Silicon Macs
(M1/M2/M3/M4). Automatically transcribes voice notes sent via Telegram or WhatsApp before the
agent processes them. Use when the user wants to enable voice message transcription locally
without any API key, or asks to set up Whisper, mlx-whisper, or local speech-to-text in OpenClaw.
Apple Silicon only (macOS darwin).
Note: Requires internet for initial model download (~465MB), but runs inference locally.
metadata:
{
"openclaw":
{
"emoji": "🎙️",
"os": ["darwin"],
"requires": { "bins": ["python3", "pip3"] },
"install":
[
{
"id": "pip-mlx-whisper",
"kind": "exec",
"command": "pip3",
"args": ["install", "mlx-whisper"],
"label": "Install mlx-whisper (Apple Silicon)",
},
],
},
}
mlx-whisper — Local Voice Transcription for Apple Silicon
Enables automatic transcription of voice notes in OpenClaw using Apple's MLX framework. No API key required. Works fully offline. ~60× faster than standard Whisper on M1/M2/M3/M4.
How it works
- User sends a voice note (Telegram
.ogg / WhatsApp .opus)
- OpenClaw downloads the audio file
- Passes it to
mlx-whisper-transcribe.sh via {{MediaPath}}
- Transcript is injected as the message body
- Agent replies to the text content
Setup
Step 1 — Install mlx-whisper
pip3 install mlx-whisper
.ogg / WhatsApp .opus)mlx-whisper-transcribe.sh via {{MediaPath}}Step 1 — Install mlx-whisper
pip3 install mlx-whisper
Verify:
python3 -c "import mlx_whisper; print('OK')"
Step 2 — Install the wrapper script
Find the Python bin path:
python3 -m site --user-base
# e.g. /Users/<you>/Library/Python/3.9
Copy bin/mlx-whisper-transcribe.sh from this skill to <user-base>/bin/mlx-whisper-transcribe.sh, then make it executable:
PYBIN=$(python3 -m site --user-base)/bin
cp {baseDir}/bin/mlx-whisper-transcribe.sh "$PYBIN/mlx-whisper-transcribe.sh"
chmod +x "$PYBIN/mlx-whisper-transcribe.sh"
Test it:
"$PYBIN/mlx-whisper-transcribe.sh" /path/to/audio.ogg
# First run downloads the model (~465MB). Subsequent runs are instant.
Step 3 — Configure OpenClaw
Add to ~/.openclaw/openclaw.json under tools.media.audio:
{
"tools": {
"media": {
"audio": {
"enabled": true,
"models": [
{
"type": "cli",
"command": "<user-base>/bin/mlx-whisper-transcribe.sh",
"args": ["{{MediaPath}}"],
"timeoutSeconds": 60
}
]
}
}
}
}
Replace <user-base> with the output of python3 -m site --user-base.
Step 4 — Restart OpenClaw
openclaw gateway restart
openclaw gateway restart
Or restart the OpenClaw app from the menu bar.
Models
The wrapper uses whisper-small-mlx by default (465MB, good balance of speed and accuracy).
To change, edit bin/mlx-whisper-transcribe.sh and update path_or_hf_repo:
| Model | Size | Use case |
|---|---|---|
mlx-community/whisper-tiny-mlx |
75MB | Fastest, basic accuracy |
mlx-community/whisper-small-mlx |
465MB | Recommended |
mlx-community/whisper-medium-mlx |
1.5GB | Higher accuracy |
mlx-community/whisper-large-v3-mlx |
3GB | Best accuracy |
Language hint (optional)
Pass a language code as the second argument to skip auto-detection (faster):
mlx-whisper-transcribe.sh audio.ogg zh # Chinese
mlx-whisper-transcribe.sh audio.ogg en # English
In openclaw.json, add the language to args:
"args": ["{{MediaPath}}", "zh"]
Performance (M3 MacBook Pro, 8GB)
Audio length
Transcription time
10 sec
~1 sec
1 min
~7 sec
30 min
~3.5 min
Troubleshooting
mlx_whisper not found: Run pip3 install mlx-whisper again
- Empty transcript: Audio may be silent or music-only (Whisper transcribes speech only)
- Timeout: Increase
timeoutSeconds for long audio files
- Wrong language: Add
"language": "zh" or the target language code to args
- Model download fails: Check internet connection; models are cached after first run in
~/.cache/huggingface
| Audio length | Transcription time |
|---|---|
| 10 sec | ~1 sec |
| 1 min | ~7 sec |
| 30 min | ~3.5 min |
mlx_whisper not found: Runpip3 install mlx-whisperagain- Empty transcript: Audio may be silent or music-only (Whisper transcribes speech only)
- Timeout: Increase
timeoutSecondsfor long audio files - Wrong language: Add
"language": "zh"or the target language code to args - Model download fails: Check internet connection; models are cached after first run in
~/.cache/huggingface
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。