Skip to content

Commit 2bb1bf2

Browse files
committed
feat: 添加服务端demo,添加乐鑫esp32s3 demo
0 parents  commit 2bb1bf2

21 files changed

+2277
-0
lines changed

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (2025) Beijing Volcano Engine Technology Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<h1 align="center"><img src="https://iam.volccdn.com/obj/volcengine-public/pic/volcengine-icon.png"></h1>
2+
<h1 align="center">IOT RTC AIGC Demo</h1>
3+
欢迎使用IOT RTC AIGC Demo,本文档为您介绍如何使用本Demo。
4+
5+
6+
# 服务端
7+
服务端demo使用python3实现的,在性能和安全性没有做任何事情,用于帮助您快速上手,跑通全部流程。代码仅供参考,您在实际使用中需要考虑并发性能和安全性。
8+
9+
服务端程序不是必要的,可以将服务端的部分逻辑内置到客户端实现。如果您需要放在客户端实现,请一定要保障SK,AK,RTC_APP_KEY的安全,避免被任何第三方获取到。
10+
## 前置准备
11+
### 服务开通
12+
请您仔细阅读,并按照[开通服务文档](https://www.volcengine.com/docs/6348/1315561)开通所需服务,并获取AK(Access Key Id), SK(Secret Access Key), RTC_APP_ID(实时音视频app id), RTC_APP_KEY(实时音视频app key), DEFAULT_BOT_ID(大模型接入点id), DEFAULT_VOICE_ID(音色类型), ASR_APP_ID(语音识别服务app id), TTS_APP_ID(语音转文本服务app id) 并填入server/src/RtcAigcConfig.py中。
13+
14+
<b style="color:red">特别提醒:请保护好您的SK,AK 和 RTC_APP_KEY,否则可能会造成您以及您的客户的信息泄露风险,还可能会造成账户财产损失。</b>
15+
16+
```
17+
SK = "Tm1FN************"
18+
AK = "AKLTY************"
19+
20+
RTC_APP_ID = "e671fa53******"
21+
RTC_APP_KEY = "62a3081******"
22+
23+
DEFAULT_BOT_ID = "ep-2025********"
24+
DEFAULT_VOICE_ID = "zh_female****"
25+
26+
ASR_APP_ID = "64410*****"
27+
TTS_APP_ID = "64410*****"
28+
29+
// 服务端口,根据需要设置
30+
PORT = 8080
31+
```
32+
33+
### 申请加入策略组
34+
Demo 目前仅支持G711A编码,需要申请加入策略组。请发送邮件到zhouhuichao@bytedance.com
35+
标题:“申请加入LLM策略组”
36+
内容:您的RTC_APP_ID,此处支持多个RTC_APP_ID
37+
加入完成后通过邮件回复。
38+
39+
### 运行环境
40+
- python3
41+
- python3 requests
42+
43+
### 启动服务
44+
```
45+
# 在server/src 目录运行
46+
python3 RtcAigcService.
47+
```
48+
49+
# 客户端
50+
51+
## 乐鑫
52+
### esp32s3
53+
#### 前置准备
54+
1. 请您参考乐鑫平台 [开发环境配置文档](https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/get-started/index.html),配置好开发环境,准备好开发工具
55+
56+
2. 填写client\espressif\esp32s3_demo\main\Config.h
57+
58+
```
59+
// 服务端的地址
60+
#define DEFAULT_SERVER_HOST "127.0.0.1:8080"
61+
62+
// 默认的智能体id
63+
#define DEFAULT_BOT_ID "ep-20240729********"
64+
65+
// 默认声音id
66+
#define DEFAULT_VOICE_ID "zh_female_*******"
67+
68+
// RTC APP ID
69+
#define DEFAULT_RTC_APP_ID "5c833ef********"
70+
```
71+
3. 从火山引擎官网获取VolcEngineRTCLite库放置到client/espressif/esp32s3_demo/components/目录下,目录结构如下:
72+
```
73+
VolcEngineRTCLite
74+
├── CMakeLists.txt
75+
├── idf_component.yml
76+
├── include
77+
│   └── VolcEngineRTCLite.h
78+
└── libs
79+
└── esp32s3
80+
└── libVolcEngineRTCLite.a
81+
```
82+
#### 使用方法
83+
1. 复制 client/espressif/esp32s3_demo 到 esp-adf工程的examples目录下
84+
2. 在乐鑫的ESP-IDF控制台中在执行下列命令
85+
```
86+
# 工作目录 esp-adf工程的examples/esp32s3_demo
87+
idf.py fullclean
88+
idf.py set-target esp32s3
89+
idf.py build
90+
idf.py flash
91+
```
92+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# For more information about build system see
2+
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
3+
# The following five lines of boilerplate have to be in your project's
4+
# CMakeLists in this exact order for cmake to work correctly
5+
cmake_minimum_required(VERSION 3.5)
6+
7+
# include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8+
9+
include($ENV{ADF_PATH}/CMakeLists.txt)
10+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
11+
project(VolcRTCDemo)
12+
13+
# add_compile_definitions(LWIP_DEBUG=1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
此文件夹中需要放置VolcEngineRTCLite库

0 commit comments

Comments
 (0)