Overview
- Skill Key
- demo112/speech-recognition
- Author
- demo112
- Source Repo
- openclaw/skills
- Version
- 1.0.0
- Source Path
- skills/demo112/speech-recognition
- Latest Commit SHA
- 873b0247a95a089c7de0cb10eb31ab8ca1a426e0
通用语音识别 Skill。支持多种音频格式(ogg/mp3/wav/m4a),使用硅基流动 SenseVoice API 进行语音转文字。当用户发送语音消息、音频文件,或需要转录音频时触发。
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 speech-recognition 技能。 若已安装,则直接安装 speech-recognition 技能。
# 通用语音识别
使用硅基流动 SenseVoice API 进行语音识别,支持多种音频格式。
---
## 激活条件
| 触发场景 | 说明 |
|----------|------|
| 用户发送语音消息 | `.ogg` / `.mp3` / `.wav` / `.m4a` 文件 |
| 用户要求转录音频 | "转录这个音频"、"语音转文字" |
| 音频文件处理 | 需要提取音频中的文字内容 |
---
## 配置
### API Key
在 `~/.openclaw/openclaw.json` 中配置:
```json
{
"providers": {
"siliconflow": {
"apiKey": "sk-xxx"
}
}
}
```
### API 端点
```
POST https://api.siliconflow.cn/v1/audio/transcriptions
```
### 支持的模型
| 模型 | 说明 |
|------|------|
| `FunAudioLLM/SenseVoiceSmall` | 默认,中文效果好 |
---
## 使用方法
### 方法一:直接调用 API
```python
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` 语音消息时:
```bash
# 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...
capt-marbles
Task Router
capncoconut
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
capevace
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
captchasco
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.
carol-gutianle
name: modelready description: Start using a local or Hugging Face model instantly, directly from chat. metadata: {"openclaw":{"requires":{"bins": "bash", "curl" }, "env": "URL" }}
canbirlik
Controls Wiz smart bulbs (turn on/off, RGB colors, disco mode) via local WiFi.