Overview
- Skill Key
- fangkelvin/voice-chat-skill
- Author
- fangkelvin
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/fangkelvin/voice-chat-skill
- Latest Commit SHA
- b67cbc10a30c35b4e512fdb13e17e9db3fb3e898
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 voice-chat 技能。 若已安装,则直接安装 voice-chat 技能。
# 语音对话技能
实现完整的双向语音对话功能,支持语音输入和语音输出。
## 功能特性
### ✅ 已实现功能
1. **文本转语音(TTS)**
- 使用OpenClaw内置tts工具
- 支持中英文混合
- 实时音频生成
2. **语音转文本(STT)**
- 使用Python speech_recognition库
- 支持麦克风输入
- 多引擎支持(Google、Whisper等)
3. **对话管理**
- 自动语音检测
- 对话上下文保持
- 中断处理
### 🔧 技术架构
```
语音输入 → STT转换 → 文本处理 → AI响应 → TTS转换 → 语音输出
```
## 安装要求
### 必需组件
1. **Python 3.8+**
2. **speech_recognition库**
3. **pyaudio库**(Windows需要额外安装)
### 可选组件
1. **Whisper** - 更准确的本地STT
2. **ElevenLabs API** - 高质量TTS
3. **OpenAI API** - 云端STT
## 快速开始
### 1. 安装依赖
```bash
# 安装Python库
pip install SpeechRecognition pyaudio
# Windows pyaudio安装(如果失败)
pip install pipwin
pipwin install pyaudio
```
### 2. 基础语音对话脚本
```python
# voice_chat.py
import speech_recognition as sr
import subprocess
import tempfile
import os
class VoiceChat:
def __init__(self):
self.recognizer = sr.Recognizer()
self.microphone = sr.Microphone()
def listen(self):
"""监听语音输入并转换为文本"""
with self.microphone as source:
print("🎤 请说话...")
audio = self.recognizer.listen(source)
try:
text = self.recognizer.recognize_google(audio, language='zh-CN')
print(f"📝 识别结果: {text}")
return text
except sr.UnknownValueError:
return "无法识别语音"
except sr.RequestError:
return "语音识别服务不可用"
def speak(self, text):
"""使用OpenClaw TTS朗读文本"""
# 调用OpenClaw tts工具
print(f"🗣️ 正在朗读: {text}")
# 这里可以集成OpenClaw tts工具
def conversation_loop(self):
"""对话循环"""
print("🎧 语音对话已启动,按Ctrl+C退出")
while True:
# 监听语音
user_input = self.listen()...
# 🎤 语音对话系统 基于OpenClaw的完整双向语音对话解决方案,支持语音输入和语音输出。 ## ✨ 功能特性 ### 🎯 核心功能 - **语音转文本(STT)**:实时识别用户语音 - **文本转语音(TTS)**:使用OpenClaw TTS生成语音响应 - **双向对话**:自然的语音交流体验 - **多语言支持**:中文优先,可扩展其他语言 ### 🔧 技术特点 - **离线/在线混合**:支持本地和云端语音识别 - **模块化设计**:易于扩展和定制 - **错误处理**:完善的异常处理和用户反馈 - **配置灵活**:支持多种语音引擎和参数调整 ## 🚀 快速开始 ### 1. 安装依赖 ```powershell # 运行安装脚本 .\install_deps.ps1 ``` ### 2. 启动系统 ```powershell # 方法1:使用启动脚本 .\voice_chat_launcher.ps1 # 方法2:直接运行 python voice_chat.py ``` ### 3. 使用菜单 ``` 📱 语音对话系统菜单 ================================================== 1. 🎧 开始语音对话 2. 🔊 测试麦克风 3. 🗣️ 测试TTS功能 4. 📋 显示系统信息 5. ❌ 退出 ================================================== ``` ## 📁 文件结构 ``` voice-chat-skill/ ├── SKILL.md # OpenClaw技能定义 ├── voice_chat.py # 主程序 ├── install_deps.ps1 # 依赖安装脚本 ├── voice_chat_launcher.ps1 # 快速启动脚本 └── README.md # 本文档 ``` ## 🔧 系统要求 ### 必需组件 - **Python 3.8+** - **麦克风**(内置或外接) - **扬声器/耳机** ### Python依赖 ```bash # 核心依赖 SpeechRecognition # 语音识别库 pyaudio # 音频输入输出 # Windows特殊安装 pipwin # Windows音频库安装工具 ``` ## 🎛️ 配置选项 ### 语音识别引擎 系统支持多种语音识别引擎: 1. **Google Speech Recognition**(默认) - 免费,需要网络 - 支持多种语言 - 准确度较高 2. **Whisper**(本地) - 离线运行 - 需要安装Whisper模型 - 隐私保护更好 3. **其他引擎** - Sphinx(离线) - Azure Speech Services - Google Cloud Speech ### 语言设置 ```python # 修改语言设置 voice_chat = VoiceChatSystem(language='zh-CN') # 中文 voice_chat = VoiceChatSystem(language='en-US') # 英文 ``` ## 💡 使用技巧 ### 最佳实践 1. **环境准备** - 在安静环境中使用 - 首次使用校准环境噪音 - 确保麦...
heyixuan2
Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pipeline: search → generate → analyze → colorize → preview → open BS → user slice → print → monitor. Supports all 9 Bambu Lab printers (A1 Mini, A1, P1S, P2S, X1C, X1E, H2C, H2S, H2D).
capt-marbles
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discoverability and citation.
carlulsoe
Local speech-to-text with NVIDIA Parakeet TDT 0.6B v3 (ONNX on CPU). 30x faster than Whisper, 25 languages, auto-detection, OpenAI-compatible API. Use when transcribing audio files, converting speech to text, or processing voice recordings locally without cloud APIs.
carlzhao007
飞书消息自动处理与进度反馈技能。安装后后台运行,监听飞书任务消息并自动创建独立进程处理。 在处理前后发送实时进度反馈(任务确认、进度百分比、完成通知)。 支持任务类型识别、智能解析、错误重试、并发控制、状态持久化。 使用场景:飞书自动化工作流、任务进度追踪、批量任务处理、需要实时反馈的场景。
cartoonitunes
BottyFans agent skill for autonomous creator monetization. Lets AI agents register, build a profile, publish posts (public, subscriber-only, or pay-to-unlock), upload media, accept USDC subscriptions and tips on Base, send and receive DMs, track earnings, and appear on the creator leaderboard. Use this skill when an agent needs to monetize content, interact with fans, manage a creator profile, handle payments in USDC, or operate as an autonomous creator on the BottyFans platform.
camopel
Local arXiv paper manager with semantic search. Crawls arXiv categories, downloads PDFs, chunks content, and indexes with FAISS + Ollama embeddings. No cloud API keys required — everything runs locally.