版本
latestv0.1.22026/4/11
安装命令
点击复制官方npx clawhub@latest install macvoice
镜像加速npx clawhub@latest install macvoice --registry https://cn.clawhub-mirror.com
插件文档
openclaw-macvoice
OpenClaw 插件,通过 voicecli 使用 macOS 原生语音 API 实现语音支持。
⚠️ 仅 macOS — 需要 macOS 13.0+,使用 Apple 框架 (SFSpeechRecognizer、AVSpeechSynthesizer)。
功能
- 🎙️ 语音转文本
- 🔊 以语音响应 — 文本转音频
- 🏠 原生 macOS — 使用
SFSpeechRecognizer和AVSpeechSynthesizer - ⚡ 快速 — 无云 API 调用,全部本地处理
前置条件
- macOS 13.0+(必需)
- voicecli 已安装:
brew tap acwilan/voicecli brew install voicecli安装
# 从 OpenClaw 技能目录 npm install openclaw-macvoice使用
基本用法
[...省略代码块,保持原样]...配置
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
voice | string | — | 语音标识符(参见 voicecli voices) |
rate | number | 0.5 | 语速(0.0-1.0) |
tempDir | string | os.tmpdir() | 临时音频文件目录 |
API
MacVoicePlugin
transcribe(audioPath: string): Promise<string>
将音频文件转换为文本。
speak(text: string, options?): Promise<string>
将文本转换为语音,返回生成的音频文件路径。
processVoiceMessage(audioPath, options)
组合方法:转录 + 可选响应语音。
平台支持
| 平台 | 状态 |
|---|---|
| macOS 13.0+ | ✅ 支持 |
| Linux | ❌ 不支持 |
| Windows | ❌ 不支持 |
许可
MIT