搜索

PythonReactSEOPDF
OpenClaw

voice-chat

语音对话集成技能,支持双向语音交流。使用TTS和STT实现完整的语音对话功能。

fangkelvin0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install fangkelvin/voice-chat-skill

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

语音对话技能

实现完整的双向语音对话功能,支持语音输入和语音输出。

功能特性

✅ 已实现功能
  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. 安装依赖
# 安装Python库
pip install SpeechRecognition pyaudio

# Windows pyaudio安装(如果失败)
pip install pipwin
pipwin install pyaudio
2. 基础语音对话脚本
# 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()...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/fangkelvin/voice-chat-skill
Version
—
Commit
b67cbc10a30c35b4e512fdb13e17e9db3fb3e898
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

🎤 语音对话系统

基于OpenClaw的完整双向语音对话解决方案,支持语音输入和语音输出。

✨ 功能特性

🎯 核心功能
  • 语音转文本(STT):实时识别用户语音
  • 文本转语音(TTS):使用OpenClaw TTS生成语音响应
  • 双向对话:自然的语音交流体验
  • 多语言支持:中文优先,可扩展其他语言
🔧 技术特点
  • 离线/在线混合:支持本地和云端语音识别
  • 模块化设计:易于扩展和定制
  • 错误处理:完善的异常处理和用户反馈
  • 配置灵活:支持多种语音引擎和参数调整

🚀 快速开始

1. 安装依赖
# 运行安装脚本
.\install_deps.ps1
2. 启动系统
# 方法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依赖
# 核心依赖
SpeechRecognition    # 语音识别库
pyaudio             # 音频输入输出

# Windows特殊安装
pipwin              # Windows音频库安装工具

🎛️ 配置选项

语音识别引擎

系统支持多种语音识别引擎:

  1. Google Speech Recognition(默认)

    • 免费,需要网络
    • 支持多种语言
    • 准确度较高
  2. Whisper(本地)

    • 离线运行
    • 需要安装Whisper模型
    • 隐私保护更好
  3. 其他引擎

    • Sphinx(离线)
    • Azure Speech Services
    • Google Cloud Speech
语言设置
# 修改语言设置
voice_chat = VoiceChatSystem(language='zh-CN')  # 中文
voice_chat = VoiceChatSystem(language='en-US')  # 英文

💡 使用技巧

最佳实践
  1. 环境准备
    • 在安静环境中使用
    • 首次使用校准环境噪音
    • 确保麦...

来源内容

SKILL.md
# 语音对话技能

实现完整的双向语音对话功能,支持语音输入和语音输出。

## 功能特性

### ✅ 已实现功能
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()...
README
# 🎤 语音对话系统

基于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. **环境准备**
   - 在安静环境中使用
   - 首次使用校准环境噪音
   - 确保麦...

相关技能

OpenClaw

bambu-studio-ai

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 pi...

OpenClaw

geo-optimization

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 discove...

OpenClaw

0protocol

0isone

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.

OpenClaw

0x0-messenger

eijiac24

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.