bambu-studio-ai
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 pi...
语音对话集成技能,支持双向语音交流。使用TTS和STT实现完整的语音对话功能。
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install fangkelvin/voice-chat-skillInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
实现完整的双向语音对话功能,支持语音输入和语音输出。
文本转语音(TTS)
语音转文本(STT)
对话管理
语音输入 → STT转换 → 文本处理 → AI响应 → TTS转换 → 语音输出
# 安装Python库
pip install SpeechRecognition pyaudio
# Windows pyaudio安装(如果失败)
pip install pipwin
pipwin install pyaudio
# 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()...
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
基于OpenClaw的完整双向语音对话解决方案,支持语音输入和语音输出。
# 运行安装脚本
.\install_deps.ps1
# 方法1:使用启动脚本
.\voice_chat_launcher.ps1
# 方法2:直接运行
python voice_chat.py
📱 语音对话系统菜单
==================================================
1. 🎧 开始语音对话
2. 🔊 测试麦克风
3. 🗣️ 测试TTS功能
4. 📋 显示系统信息
5. ❌ 退出
==================================================
voice-chat-skill/
├── SKILL.md # OpenClaw技能定义
├── voice_chat.py # 主程序
├── install_deps.ps1 # 依赖安装脚本
├── voice_chat_launcher.ps1 # 快速启动脚本
└── README.md # 本文档
# 核心依赖
SpeechRecognition # 语音识别库
pyaudio # 音频输入输出
# Windows特殊安装
pipwin # Windows音频库安装工具
系统支持多种语音识别引擎:
Google Speech Recognition(默认)
Whisper(本地)
其他引擎
# 修改语言设置
voice_chat = VoiceChatSystem(language='zh-CN') # 中文
voice_chat = VoiceChatSystem(language='en-US') # 英文
# 语音对话技能
实现完整的双向语音对话功能,支持语音输入和语音输出。
## 功能特性
### ✅ 已实现功能
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. **环境准备** - 在安静环境中使用 - 首次使用校准环境噪音 - 确保麦...
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 pi...
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 discove...
Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.
Send and receive P2P messages using disposable numbers and PINs. No servers, no accounts. Use for human notifications, approval flows, and agent-to-agent communication.