通用语音识别 Skill。支持多种音频格式(ogg/mp3/wav/m4a),使用硅基流动 SenseVoice API 进行语音转文字。当用户发送语音消息、音频文件,或需要转录音频时触发。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install speech-recognition或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install speech-recognition⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/speech-recognition/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: speech-recognition description: "通用语音识别 Skill。支持多种音频格式(ogg/mp3/wav/m4a),使用硅基流动 SenseVoice API 进行语音转文字。当用户发送语音消息、音频文件,或需要转录音频时触发。" version: "1.0.0" ---
使用硅基流动 SenseVoice API 进行语音识别,支持多种音频格式。
---
| 触发场景 | 说明 | |----------|------| | 用户发送语音消息 | .ogg / .mp3 / .wav / .m4a 文件 | | 用户要求转录音频 | "转录这个音频"、"语音转文字" | | 音频文件处理 | 需要提取音频中的文字内容 |
---
在 ~/.openclaw/openclaw.json 中配置:
{
"providers": {
"siliconflow": {
"apiKey": "sk-xxx"
}
}
}
POST https://api.siliconflow.cn/v1/audio/transcriptions
| 模型 | 说明 | |------|------| | FunAudioLLM/SenseVoiceSmall | 默认,中文效果好 |
---
import requests
api_key = "sk-xxx"
with open("/path/to/audio.mp3", "rb") as f:
audio_data = f.read()
response = requests.post(
"https://api.siliconflow.cn/v1/audio/transcriptions",
headers={"Authorization": f"Bearer {api_key}"},
files={"file": ("audio.mp3", audio_data, "audio/mpeg")},
data={"model": "FunAudioLLM/SenseVoiceSmall"},
timeout=60
)
print(response.json().get("text", ""))
当用户发送 .ogg 语音消息时:
# 1. 转换格式(如果是 ogg)
ffmpeg -i /path/to/audio.ogg -ar 16000 -ac 1 /tmp/audio.mp3 -y
# 2. 调用硅基流动 API(API Key 从环境变量读取)
python3 -c "
import requests
import os
api_key = os.environ.get('SILICONFLOW_API_KEY')
if not api_key:
raise ValueError('请设置 SILICONFLOW_API_KEY 环境变量')
with open('/tmp/audio.mp3', 'rb') as f:
audio_data = f.read()
response = requests.post(
'https://api.siliconflow.cn/v1/audio/transcriptions',
headers={'Authorization': f'Bearer {api_key}'},
files={'file': ('audio.mp3', audio_data, 'audio/mpeg')},
data={'model': 'FunAudioLLM/SenseVoiceSmall'},
timeout=60
)
print(response.json().get('text', ''))
"
---
| 格式 | 扩展名 | 说明 | |------|--------|------| | MP3 | .mp3 | 推荐,兼容性好 | | OGG | .ogg | Telegram/Signal 语音格式,需转换 | | WAV | .wav | 无压缩,文件大 | | M4A | .m4a | iOS 录音格式 | | FLAC | .flac | 无损压缩 |
---
如果音频不是 MP3 格式,用 FFmpeg 转换:
# OGG → MP3
ffmpeg -i input.ogg -ar 16000 -ac 1 output.mp3 -y
# WAV → MP3
ffmpeg -i input.wav -ar 16000 -ac 1 output.mp3 -y
# M4A → MP3
ffmpeg -i input.m4a -ar 16000 -ac 1 output.mp3 -y
参数说明:
-ar 16000: 采样率 16kHz(语音识别推荐)-ac 1: 单声道(减少文件大小)-y: 覆盖已存在的文件---
| 错误 | 原因 | 解决 | |------|------|------| | 401 Unauthorized | API Key 无效 | 检查配置 | | 413 Payload Too Large | 文件太大 | 压缩或分割音频 | | timeout | 网络超时 | 重试或检查网络 | | Invalid audio format | 格式不支持 | 用 FFmpeg 转换 |
---
---
| Skill | 说明 | |-------|------| | douyin-video | 抖音视频语音提取 | | cosyvoice-tts | 文字转语音 |
---
版本:1.0.0 创建于:2026-02-26
安装 speech-recognition 后,可以对 AI 说这些话来触发它
Help me get started with speech-recognition
Explains what speech-recognition does, walks through the setup, and runs a quick demo based on your current project
Use speech-recognition to universal speech recognition skill
Invokes speech-recognition with the right parameters and returns the result directly in the conversation
What can I do with speech-recognition in my design & creative workflow?
Lists the top use cases for speech-recognition, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/speech-recognition/ 目录(个人级,所有项目可用),或 .claude/skills/speech-recognition/(项目级)。重启 AI 客户端后,用 /speech-recognition 主动调用,或让 AI 根据上下文自动发现并使用。
speech-recognition 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
speech-recognition 可免费安装使用。请查阅仓库了解许可证信息。
通用语音识别 Skill。支持多种音频格式(ogg/mp3/wav/m4a),使用硅基流动 SenseVoice API 进行语音转文字。当用户发送语音消息、音频文件,或需要转录音频时触发。
speech-recognition 属于「Design & Creative」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my design & creative tasks using speech-recognition
Identifies repetitive steps in your workflow and sets up speech-recognition to handle them automatically