humanpages
Search and hire real humans for tasks — photography, delivery, research, and more
Feishu Voice Skill 飞书语音交互技能
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install godzff/feishu-voice-lobster打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
本技能用于实现飞书与 ElevenLabs 的语音交互,包括:
export ELEVENLABS_API_KEY="你的API Key"
apt-get update && apt-get install -y ffmpeg
用户发送语音时,收到的是 file_key,需要通过以下步骤下载:
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{"app_id":"你的app_id","app_secret":"你的app_secret"}' | grep -o '"tenant_access_token":"[^"]*"' | cut -d'"' -f4)
# 下载语音文件
curl -s "https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/resources/{file_key}?type=file" \
-H "Authorization: Bearer $TOKEN" -o /path/to/voice.ogg
curl -s -X POST "https://api.elevenlabs.io/v1/speech-to-text?enable_logging=true" \
-H "xi-api-key: ${ELEVENLABS_API_KEY}" \
-F model_id="scribe_v1" \
-F file=@/path/to/voice.ogg
返回结果包含 text 字段,即识别出的文字内容。
curl -s -X POST "https://api.elevenlabs.io/v1/text-to-speech/pNInz6obpgDQGcFmaJgB" \
-H "Content-Type: application/json" \
-H "xi-api-key: ${ELEVENLABS_API_KEY}" \
-d '{
"text": "要转换的文字",
"model_id": "eleven_multilingual_v2"
}' -o /path/to/output.mp3
飞书语音需要 Ogg/Opus 格式,需要用 FFmpeg 转换:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -acodec libopus output.ogg -y
const { Client } = require('@larksuiteoapi/node-sdk');
const fs = require('fs');
const client = new Client({
appId: '你的appId',
appSecret: '你的appSecret',
});
async function sendVoice(fil...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
# Feishu Voice Skill - 飞书语音交互技能
## 概述
本技能用于实现飞书与 ElevenLabs 的语音交互,包括:
- 语音转文字(用户发语音 → 识别内容)
- 文字转语音(生成语音回复用户)
- 飞书语音消息的收发
---
## 1. 环境配置
### 1.1 ElevenLabs API Key
```bash
export ELEVENLABS_API_KEY="你的API Key"
```
### 1.2 FFmpeg 安装
```bash
apt-get update && apt-get install -y ffmpeg
```
---
## 2. 语音转文字(用户语音识别)
### 2.1 下载飞书语音
用户发送语音时,收到的是 `file_key`,需要通过以下步骤下载:
```bash
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{"app_id":"你的app_id","app_secret":"你的app_secret"}' | grep -o '"tenant_access_token":"[^"]*"' | cut -d'"' -f4)
# 下载语音文件
curl -s "https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/resources/{file_key}?type=file" \
-H "Authorization: Bearer $TOKEN" -o /path/to/voice.ogg
```
### 2.2 ElevenLabs 语音转文字
```bash
curl -s -X POST "https://api.elevenlabs.io/v1/speech-to-text?enable_logging=true" \
-H "xi-api-key: ${ELEVENLABS_API_KEY}" \
-F model_id="scribe_v1" \
-F file=@/path/to/voice.ogg
```
返回结果包含 `text` 字段,即识别出的文字内容。
---
## 3. 文字转语音
### 3.1 ElevenLabs TTS 生成
```bash
curl -s -X POST "https://api.elevenlabs.io/v1/text-to-speech/pNInz6obpgDQGcFmaJgB" \
-H "Content-Type: application/json" \
-H "xi-api-key: ${ELEVENLABS_API_KEY}" \
-d '{
"text": "要转换的文字",
"model_id": "eleven_multilingual_v2"
}' -o /path/to/output.mp3
```
### 3.2 转换为飞书兼容格式
飞书语音需要 **Ogg/Opus 格式**,需要用 FFmpeg 转换:
```bash
ffmpeg -i input.mp3 -ar 16000 -ac 1 -acodec libopus output.ogg -y
```
---
## 4. 发送语音消息(飞书)
### 4.1 Node.js 实现
```javascript
const { Client } = require('@larksuiteoapi/node-sdk');
const fs = require('fs');
const client = new Client({
appId: '你的appId',
appSecret: '你的appSecret',
});
async function sendVoice(fil...Search and hire real humans for tasks — photography, delivery, research, and more
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.
Attio CRM integration for managing companies, people, deals, notes, tasks, and custom objects. Use when working with Attio CRM data, searching contacts, managing sales pipelines, adding notes to records, creati...
Web scraping and crawling with Firecrawl API. Fetch webpage content as markdown, take screenshots, extract structured data, search the web, and crawl documentation sites. Use when the user needs to scrape a URL...