nzjsdsk commited on
Commit
3e2982c
·
verified ·
1 Parent(s): ef72a58

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +33 -167
README.md CHANGED
@@ -1,167 +1,33 @@
1
- # py-xiaozhi
2
- <p align="center">
3
- <a href="https://github.com/huangjunsen0406/py-xiaozhi/releases/latest">
4
- <img src="https://img.shields.io/github/v/release/huangjunsen0406/py-xiaozhi?style=flat-square&logo=github&color=blue" alt="Release"/>
5
- </a>
6
- <a href="https://opensource.org/licenses/MIT">
7
- <img src="https://img.shields.io/badge/License-MIT-green.svg?style=flat-square" alt="License: MIT"/>
8
- </a>
9
- <a href="https://github.com/huangjunsen0406/py-xiaozhi/stargazers">
10
- <img src="https://img.shields.io/github/stars/huangjunsen0406/py-xiaozhi?style=flat-square&logo=github" alt="Stars"/>
11
- </a>
12
- <a href="https://github.com/huangjunsen0406/py-xiaozhi/releases/latest">
13
- <img src="https://img.shields.io/github/downloads/huangjunsen0406/py-xiaozhi/total?style=flat-square&logo=github&color=52c41a1&maxAge=86400" alt="Download"/>
14
- </a>
15
- <a href="https://gitee.com/huang-jun-sen/py-xiaozhi">
16
- <img src="https://img.shields.io/badge/Gitee-FF5722?style=flat-square&logo=gitee" alt="Gitee"/>
17
- </a>
18
- </p>
19
-
20
-
21
-
22
- 简体中文 | [English](README.en.md)
23
-
24
- ## 项目简介
25
- py-xiaozhi 是一个使用 Python 实现的小智语音客户端,旨在通过代码学习和在没有硬件条件下体验 AI 小智的语音功能。
26
- 本仓库是基于[xiaozhi-esp32](https://github.com/78/xiaozhi-esp32)移植
27
-
28
- ## 演示
29
- - [Bilibili 演示视频](https://www.bilibili.com/video/BV1HmPjeSED2/#reply255921347937)
30
-
31
- ![Image](https://github.com/user-attachments/assets/df8bd5d2-a8e6-4203-8084-46789fc8e9ad)
32
-
33
- ## 功能特点
34
- - **AI语音交互**:支持语音输入与识别,实现智能人机交互,提供自然流畅的对话体验。
35
- - **视觉多模态**:支持图像识别和处理,提供多模态交互能力,理解图像内容。
36
- - **IoT 设备集成**:支持智能家居设备控制,实现更多物联网功能,打造智能家居生态。
37
- - **联网音乐播放**:基于pygame实现的高性能音乐播放器,支持歌词显示和本地缓存,支持播放/暂停/停止、进度控制、歌词显示和本地缓存,提供更稳定的音乐播放体验。
38
- - **语音唤醒**:支持唤醒词激活交互,免去手动操作的烦恼(默认关闭需要手动开启)。
39
- - **自动对话模式**:实现连续对话体验,提升用户交互流畅度。
40
- - **图形化界面**:提供直观易用的 GUI,支持小智表情与文本显示,增强视觉体验。
41
- - **命令行模式**:支持 CLI 运行,适用于嵌入式设备或无 GUI 环境。
42
- - **跨平台支持**:兼容 Windows 10+、macOS 10.15+ 和 Linux 系统,随时随地使用。
43
- - **音量控制**:支持音量调节,适应不同环境需求,统一声音控制接口。
44
- - **会话管理**:有效管理多轮对话,保持交互的连续性。
45
- - **加密音频传输**:支持 WSS 协议,保障音频数据的安全性,防止信息泄露。
46
- - **自动验证码处理**:首次使用时,程序自动复制验证码并打开浏览器,简化用户操作。
47
- - **自动获取 MAC 地址**:避免 MAC 地址冲突,提高连接稳定性。
48
- - **代码模块化**:拆分代码并封装为类,职责分明,便于二次开发。
49
- - **稳定性优化**:修复多项问题,包括断线重连、跨平台兼容等。
50
-
51
- ## 系统要求
52
- - 3.9 >= Python版本 <= 3.12
53
- - 支持的操作系统:Windows 10+、macOS 10.15+、Linux
54
- - 麦克风和扬声器设备
55
-
56
- ## 请先看这里!
57
- - 仔细阅读 [项目文档](https://huangjunsen0406.github.io/py-xiaozhi/) 启动教程和文件说明都在里面了
58
- - main是最新代码,每次更新都需要手动重新安装一次pip依赖防止我新增依赖后你们本地没有
59
-
60
- [从零开始使用小智客户端(视频教程)](https://www.bilibili.com/video/BV1dWQhYEEmq/?vd_source=2065ec11f7577e7107a55bbdc3d12fce)
61
-
62
- ## 状态流转图
63
-
64
- ```
65
- +----------------+
66
- | |
67
- v |
68
- +------+ 唤醒词/按钮 +------------+ | +------------+
69
- | IDLE | -----------> | CONNECTING | --+-> | LISTENING |
70
- +------+ +------------+ +------------+
71
- ^ |
72
- | | 语音识别完成
73
- | +------------+ v
74
- +--------- | SPEAKING | <-----------------+
75
- 完成播放 +------------+
76
- ```
77
-
78
- ## 待实现功能
79
- - [ ] **新 GUI(Electron)**:提供更现代、美观的用户界面,优化交互体验。
80
-
81
- ## 常见问题
82
- - **找不到音频设备**:请检查麦克风和扬声器是否正常连接和启用。
83
- - **唤醒词不响应**:请检查`config.json`中的`USE_WAKE_WORD`设置是否为`true`,以及模型路径是否正确。
84
- - **网络连接失败**:请检查网络设置和防火墙配置,确保WebSocket或MQTT通信未被阻止。
85
- - **打包失败**:确保已安装PyInstaller (`pip install pyinstaller`),并且所有依赖项都已安装。然后重新执行`python scripts/build.py`
86
-
87
- ## 相关第三方开源项目
88
- [小智手机端](https://github.com/TOM88812/xiaozhi-android-client)
89
-
90
- [xiaozhi-esp32-server(开源服务端)](https://github.com/xinnan-tech/xiaozhi-esp32-server)
91
-
92
- [XiaoZhiAI_server32_Unity(Unity开发)](https://gitee.com/vw112266/XiaoZhiAI_server32_Unity)
93
-
94
- [IntelliConnect(Aiot中间件)](https://github.com/ruanrongman/IntelliConnect)
95
-
96
- [open-xiaoai(小爱音响接入小智)](https://github.com/idootop/open-xiaoai.git)
97
-
98
- ## 相关分支
99
- - main 主分支
100
- - feature/v1 第一个版本
101
- - feature/visual 视觉分支
102
- - feature/raspberry_pi 嵌入式设备分支
103
- ## 项目结构
104
-
105
- ```
106
- ├── .github # GitHub 相关配置
107
- ├── assets # 资源文件(表情动画等)
108
- ├── cache # 缓存目录(音乐等临时文件)
109
- ├── config # 配置文件目录
110
- ├── documents # 文档目录
111
- ├── hooks # PyInstaller钩子目录
112
- ├── libs # 依赖库目录
113
- ├── scripts # 实用脚本目录
114
- ├── src # 源代码目录
115
- │ ├── audio_codecs # 音频编解码模块
116
- │ ├── audio_processing # 音频处理模块
117
- │ ├── constants # 常量定义
118
- │ ├── display # 显示界面模块
119
- │ ├── iot # IoT设备相关模块
120
- │ │ └── things # 具体设备实现目录
121
- │ ├── network # 网络通信模块
122
- │ ├── protocols # 通信协议模块
123
- │ └── utils # 工具类模块
124
- ```
125
-
126
- ## 贡献指南
127
- 欢迎提交问题报告和代码贡献。请确保遵循以下规范:
128
-
129
- 1. 代码风格符合PEP8规范
130
- 2. 提交的PR包含适当的测试
131
- 3. 更新相关文档
132
-
133
- ## 社区与支持
134
-
135
- ### 感谢以下开源人员
136
- > 排名不分前后
137
-
138
- [Xiaoxia](https://github.com/78)
139
- [zhh827](https://github.com/zhh827)
140
- [四博智联-李洪刚](https://github.com/SmartArduino)
141
- [HonestQiao](https://github.com/HonestQiao)
142
- [vonweller](https://github.com/vonweller)
143
- [孙卫公](https://space.bilibili.com/416954647)
144
- [isamu2025](https://github.com/isamu2025)
145
- [Rain120](https://github.com/Rain120)
146
- [kejily](https://github.com/kejily)
147
- [电波bilibili君](https://space.bilibili.com/119751)
148
-
149
- ### 赞助支持
150
-
151
- <div align="center">
152
- <h3>感谢所有赞助者的支持 ❤️</h3>
153
- <p>无论是接口资源、设备兼容测试还是资金支持,每一份帮助都让项目更加完善</p>
154
-
155
- <a href="https://huangjunsen0406.github.io/py-xiaozhi/sponsors/" target="_blank">
156
- <img src="https://img.shields.io/badge/查看-赞助者名单-brightgreen?style=for-the-badge&logo=github" alt="赞助者名单">
157
- </a>
158
- <a href="https://huangjunsen0406.github.io/py-xiaozhi/sponsors/" target="_blank">
159
- <img src="https://img.shields.io/badge/成为-项目赞助者-orange?style=for-the-badge&logo=heart" alt="成为赞助者">
160
- </a>
161
- </div>
162
-
163
- ## 项目统计
164
- [![Star History Chart](https://api.star-history.com/svg?repos=huangjunsen0406/py-xiaozhi&type=Date)](https://www.star-history.com/#huangjunsen0406/py-xiaozhi&Date)
165
-
166
- ## 许可证
167
- [MIT License](LICENSE)
 
1
+ ---
2
+ title: "py-xiaozhi Demo" # 必须为字符串 :contentReference[oaicite:0]{index=0}
3
+ emoji: "🤖" # 必须为字符串,仅允许单个 emoji 字符 :contentReference[oaicite:1]{index=1}
4
+ colorFrom: red # 必须是 [red, yellow, green, blue, indigo, purple, pink, gray] 之一 :contentReference[oaicite:2]{index=2}
5
+ colorTo: pink # 同上 :contentReference[oaicite:3]{index=3}
6
+ sdk: gradio # 必须是 [gradio, streamlit, docker, static] 之一 :contentReference[oaicite:4]{index=4}
7
+ sdk_version: "3.53.2" # 必须为字符串,指定 SDK 版本 :contentReference[oaicite:5]{index=5}
8
+ python_version: "3.10" # 可选,必须为字符串,指定 Python 版本 :contentReference[oaicite:6]{index=6}
9
+ app_file: app.py # 必须为字符串,指定入口脚本路径 :contentReference[oaicite:7]{index=7}
10
+ short_description: "基于 py-xiaozhi 的语音交互 Demo" # 必须为字符串,用于缩略图下方简介 :contentReference[oaicite:8]{index=8}
11
+ tags:
12
+ - ai
13
+ - gradio
14
+ - speech # 必须为字符串列表,描述任务场景 :contentReference[oaicite:9]{index=9}
15
+ models:
16
+ - openai-community/gpt2 # HF 模型 ID 列表 :contentReference[oaicite:10]{index=10}
17
+ datasets:
18
+ - mozilla-foundation/common_voice_13_0 # HF 数据集 ID 列表 :contentReference[oaicite:11]{index=11}
19
+ pinned: false # 必须为布尔值,是否置顶 :contentReference[oaicite:12]{index=12}
20
+ ---
21
+
22
+ # py-xiaozhi Demo
23
+
24
+ 基于 py-xiaozhi 的语音交互 Web 应用示例。
25
+
26
+ > 📖 配置选项完整参考:
27
+ > https://huggingface.co/docs/hub/spaces-config-reference :contentReference[oaicite:13]{index=13}
28
+
29
+ ## 快速开始
30
+
31
+ 1. 安装依赖
32
+ ```bash
33
+ pip install -r requirements.txt