ClassLiveSubtitle 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,396 @@
1
+ Metadata-Version: 2.4
2
+ Name: ClassLiveSubtitle
3
+ Version: 1.0.0
4
+ Summary: Real-time speech translation CLI using Volcengine AST 2.0
5
+ Author-email: ChHsiching <hsichingchang@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: speech-translation,live-subtitle,volcengine,ast
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
14
+ Requires-Python: >=3.11
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: websockets>=13.0
17
+ Requires-Dist: protobuf>=5.0
18
+ Requires-Dist: sounddevice>=0.5.0
19
+ Requires-Dist: pyaudio>=0.2.14
20
+ Requires-Dist: python-dotenv>=1.0
21
+ Provides-Extra: linux
22
+ Requires-Dist: pulsectl>=24.0; extra == "linux"
23
+
24
+ # ClassLiveSubtitle — 课堂实时翻译字幕
25
+
26
+ > 基于火山引擎同声传译 2.0 (AST) 的实时语音翻译工具,带系统托盘 GUI 和浮动字幕。
27
+
28
+ 对外教课堂上的英语进行实时翻译,中文悬浮字幕覆盖在屏幕下方。也支持 CLI 模式。
29
+
30
+ **功能:**
31
+ - 系统托盘图标 — 应用图标 + 状态指示圆点,一键开始/停止翻译
32
+ - 设置面板 — QWebEngine 驱动的现代 UI(Notion 风格),无边框窗口,深色/浅色主题
33
+ - 悬浮字幕 — 实时显示原文和翻译,支持拖拽移动,延迟创建避免黑屏
34
+ - 音量指示条 — 测试麦克风时实时显示音量
35
+ - 设备管理 — 设备热插拔自动刷新列表,断开自动切换系统默认
36
+ - 错误反馈 — 连接失败或异常时显示提示信息
37
+ - 断线自动重连 — 网络波动后自动恢复
38
+ - Linux 非独占录音 — PipeWire 逐流路由,不独占麦克风设备
39
+ - 设置持久化 — 麦克风、语言、字幕位置、字体大小自动保存
40
+ - API Key 引导 — 首次启动自动弹出配置向导,加密存储
41
+ - 快速退出 — 托盘图标立即消失,无残留
42
+ - 打包为 `ClassLiveSubtitle.exe` — 无需安装 Python,双击即用
43
+
44
+ ---
45
+
46
+ ## 快速开始
47
+
48
+ ### 方式一:直接运行 exe(Windows)
49
+
50
+ 1. 下载 `ClassLiveSubtitle.exe`
51
+ 2. 双击运行
52
+ 3. 首次启动会弹出 API Key 配置向导,按提示获取并粘贴 Key
53
+ 4. 系统托盘出现应用图标
54
+ 5. 右键托盘图标 → Settings... → 选择麦克风和语言
55
+ 6. 右键托盘图标 → Start Translation 开始翻译
56
+
57
+ ### 方式二:从源码运行
58
+
59
+ #### 前置要求
60
+
61
+ - **Python 3.12+**(推荐 3.12 或 3.13)
62
+ - **Git**
63
+
64
+ #### 方法 A:使用 uv(推荐)
65
+
66
+ ```bash
67
+ # 安装 uv(只需一次)
68
+ # Windows:
69
+ winget install astral-sh.uv
70
+ # Linux/macOS:
71
+ curl -LsSf https://astral.sh/uv/install.sh | sh
72
+
73
+ # 克隆项目
74
+ git clone git@github.com:ChHsiching/ClassLiveSubtitle.git
75
+ cd ClassLiveSubtitle
76
+
77
+ # 创建虚拟环境并安装依赖
78
+ uv venv
79
+ uv pip install -r requirements.txt
80
+
81
+ # 激活虚拟环境
82
+ # Windows PowerShell:
83
+ .venv\Scripts\Activate.ps1
84
+ # Linux/macOS:
85
+ source .venv/bin/activate
86
+
87
+ # 启动 GUI
88
+ python -m gui
89
+ ```
90
+
91
+ #### 方法 B:使用 pip
92
+
93
+ ```bash
94
+ # 克隆项目
95
+ git clone git@github.com:ChHsiching/ClassLiveSubtitle.git
96
+ cd ClassLiveSubtitle
97
+
98
+ # 创建虚拟环境
99
+ python -m venv .venv
100
+
101
+ # 激活虚拟环境
102
+ # Windows PowerShell:
103
+ .venv\Scripts\Activate.ps1
104
+ # Linux/macOS:
105
+ source .venv/bin/activate
106
+
107
+ # 安装依赖
108
+ pip install -r requirements.txt
109
+
110
+ # 启动 GUI
111
+ python -m gui
112
+ ```
113
+
114
+ > **注意:** 如果安装 pyaudio 报错:
115
+ > - **Ubuntu/Debian**: `sudo apt install portaudio19-dev` 然后重试
116
+ > - **macOS**: `brew install portaudio` 然后重试
117
+ > - **Windows**: 通常直接成功
118
+
119
+ ---
120
+
121
+ ## GUI 使用说明
122
+
123
+ ### 设置面板
124
+
125
+ 无边框 QWebEngine 窗口,支持:
126
+ - 麦克风设备选择与测试(绿色指示灯)
127
+ - 源语言切换(英文、德语、法语、日语等)
128
+ - 字幕样式预设(深色、浅色、透明)
129
+ - 显示模式(仅翻译、原文+翻译、仅原文)
130
+ - 字体大小滑块
131
+ - 深色/浅色主题切换
132
+
133
+ ### 系统托盘菜单
134
+
135
+ 右键托盘图标可以看到:
136
+
137
+ | 菜单项 | 功能 |
138
+ |--------|------|
139
+ | Start/Stop Translation | 开始或停止翻译 |
140
+ | Settings... | 打开设置面板 |
141
+ | Move Overlay | 开启/关闭字幕拖拽模式 |
142
+ | Show/Hide Subtitle | 显示或隐藏悬浮字幕 |
143
+ | Exit | 退出程序 |
144
+
145
+ ### 托盘图标状态指示
146
+
147
+ 图标右下角的圆点颜色表示当前状态:
148
+
149
+ | 圆点颜色 | 状态 |
150
+ |------|------|
151
+ | 蓝色 | 已连接,正在翻译 |
152
+ | 黄色 | 正在重连 |
153
+ | 灰色 | 未连接 |
154
+
155
+ ### 悬浮字幕
156
+
157
+ - 默认显示在屏幕下方
158
+ - 开启 Move Overlay 后拖拽字幕窗口
159
+ - 支持"仅翻译"、"原文+翻译"、"仅原文"三种显示模式
160
+ - 字体大小可在设置面板调整
161
+
162
+ ### 支持的语言
163
+
164
+ | 代码 | 语言 |
165
+ |------|------|
166
+ | `zh` | 中文 |
167
+ | `en` | 英文 |
168
+ | `ja` | 日语 |
169
+ | `id` | 印尼语 |
170
+ | `es` | 西班牙语 |
171
+ | `pt` | 葡萄牙语 |
172
+ | `de` | 德语 |
173
+ | `fr` | 法语 |
174
+ | `zhen` | 中英混合 |
175
+
176
+ ---
177
+
178
+ ## 打包为 exe
179
+
180
+ 在 **Windows** 机器上运行(PyInstaller 不支持交叉编译):
181
+
182
+ ```bash
183
+ # 1. 确保已激活虚拟环境
184
+ .venv\Scripts\Activate.ps1
185
+
186
+ # 2. 安装依赖和 PyInstaller(选择你之前用的工具)
187
+ # uv 用户:
188
+ uv pip install -r requirements.txt pyinstaller
189
+ # pip 用户:
190
+ pip install -r requirements.txt pyinstaller
191
+
192
+ # 3. 打包
193
+ python packaging/build.py
194
+
195
+ # 输出
196
+ # dist/ClassLiveSubtitle.exe(约 200MB)
197
+ ```
198
+
199
+ 也可以清理后重新打包:
200
+
201
+ ```bash
202
+ python packaging/build.py --clean
203
+ ```
204
+
205
+ > **注意:** 打包时需要确保 `gui/web/` 目录存在(包含 HTML/CSS/JS 前端资源)。
206
+
207
+ ---
208
+
209
+ ## 高级:CLI 模式
210
+
211
+ 除了 GUI,项目也提供命令行模式,适合脚本化使用或调试。
212
+
213
+ ### 配置 API Key(CLI 专用)
214
+
215
+ GUI 模式首次启动时会自动弹出配置向导,无需手动操作。CLI 模式需要手动配置 `.env` 文件。
216
+
217
+ #### 第一步:获取 API Key
218
+
219
+ 1. 注册 [火山引擎](https://www.volcengine.com) 账号并完成实名认证
220
+ 2. 打开新版控制台:https://console.volcengine.com/speech/new
221
+ 3. 左侧点击「语音同传大模型」→ 开通服务
222
+ 4. 概览页 → API 接入 → 创建 API Key → 复制保存
223
+
224
+ #### 第二步:写入配置文件
225
+
226
+ ```bash
227
+ cp .env.example .env
228
+ ```
229
+
230
+ 编辑 `.env` 文件:
231
+
232
+ ```
233
+ AST_API_KEY=你的API_Key
234
+ AST_RESOURCE_ID=volc.service_type.10053
235
+ AST_WS_URL=wss://openspeech.bytedance.com/api/v4/ast/v2/translate
236
+ ```
237
+
238
+ > **注意:** API Key 只在创建时显示一次,请立即保存!新版控制台只需 `AST_API_KEY` 一项。
239
+ > 旧版控制台用户需额外填写 `AST_ACCESS_KEY`,详见 [.env.example](.env.example)。
240
+
241
+ 如需详细的 API Key 获取教程,参考以下官方文档:
242
+ - 快速入门:https://www.volcengine.com/docs/6561/2119699
243
+ - API Key 管理:https://www.volcengine.com/docs/6561/1816214
244
+ - 同声传译 2.0 API:https://www.volcengine.com/docs/6561/1756902
245
+
246
+ ### CLI 运行
247
+
248
+ ```bash
249
+ # 中文翻译成英文
250
+ python -m src --mode s2t --source zh --target en
251
+
252
+ # 英文翻译成中文
253
+ python -m src --mode s2t --source en --target zh
254
+
255
+ # 用音频文件测试
256
+ python -m src --mode s2t --source en --target zh --file test_audio.wav
257
+
258
+ # 查看可用麦克风
259
+ python -m src --list-devices
260
+
261
+ # 指定麦克风
262
+ python -m src --mode s2t --source en --target zh --device 2
263
+ ```
264
+
265
+ ### CLI 运行效果
266
+
267
+ ```
268
+ 🎙️ 同声传译系统
269
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
270
+ 模式: s2t (语音→文字) | zh → en
271
+ 麦克风: 16kHz/16bit/单声道 | 80ms/包
272
+ 按 Ctrl+C 停止
273
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
274
+
275
+ [原文] 今天我们来学习英语的基础语法
276
+ [译文] Today we are going to learn the basic grammar of English
277
+
278
+ [原文] 首先,我们来看一下名词的分类
279
+ [译文] First, let's look at the classification of nouns
280
+
281
+ ^C
282
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
283
+ 会话结束 | 时长: 45.2s | Token: 128
284
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
285
+ ```
286
+
287
+ ### CLI 选项说明
288
+
289
+ | 选项 | 说明 | 默认值 |
290
+ |------|------|--------|
291
+ | `--mode` | `s2t`(仅文字)或 `s2s`(含语音) | `s2t` |
292
+ | `--source` | 源语言 | `zh` |
293
+ | `--target` | 目标语言 | `en` |
294
+ | `--file` | 音频文件路径 | 无 |
295
+ | `--device` | 麦克风设备编号 | 自动选择 |
296
+ | `--api-key` | 直接传 API Key | 从 .env 读取 |
297
+ | `--list-devices` | 列出所有麦克风设备 | — |
298
+ | `--debug` | 显示详细调试日志 | 关闭 |
299
+
300
+ ---
301
+
302
+ ## 常见问题
303
+
304
+ ### GUI 相关
305
+
306
+ **Q: 托盘图标不显示?**
307
+ A: Windows 10/11 默认会隐藏新托盘图标。点击任务栏右下角的 `^` 箭头,找到应用图标,拖拽到任务栏即可。
308
+
309
+ **Q: 悬浮字幕位置不对?**
310
+ A: 右键托盘图标 → Move Overlay 开启拖拽模式,拖拽字幕到目标位置。位置会自动保存。
311
+
312
+ **Q: 翻译没有声音/不工作?**
313
+ A: 右键托盘图标 → Settings... → 确认选择了正确的麦克风设备。如果列表为空,检查系统麦克风权限。
314
+
315
+ **Q: 提示 "连接翻译服务失败,请检查网络"?**
316
+ A: 程序会自动重连(最多 3 次,间隔 2s/4s/8s)。如果持续失败,检查网络连接。
317
+
318
+ ### CLI 相关
319
+
320
+ **Q: 提示 "AST_API_KEY is required"?**
321
+ A: 需要配置 `.env` 文件,参见 [配置 API Key](#配置-api-keycli-专用)。
322
+
323
+ **Q: 提示 "连接失败: HTTP 401"?**
324
+ A: 认证失败。确认已在火山引擎控制台开通同声传译服务,且 API Key 正确。新版控制台只需 `AST_API_KEY`。
325
+
326
+ **Q: 麦克风没有声音?**
327
+ A: 运行 `python -m src --list-devices` 查看设备,用 `--device` 指定编号。确保系统已授权麦克风权限。
328
+
329
+ **Q: 安装 pyaudio 报错?**
330
+ A:
331
+ - **Ubuntu/Debian**: `sudo apt install portaudio19-dev`
332
+ - **macOS**: `brew install portaudio`
333
+ - **Windows**: 安装 [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
334
+
335
+ **Q: 翻译延迟较大?**
336
+ A: 正常现象。语速适中、句间停顿可降低延迟。s2t 模式比 s2s 延迟更小。
337
+
338
+ ---
339
+
340
+ ## 项目结构
341
+
342
+ ```
343
+ ClassLiveSubtitle/
344
+ ├── gui/ # GUI 应用
345
+ │ ├── __main__.py # 入口:python -m gui
346
+ │ ├── app.py # 应用初始化,托盘/Worker/字幕生命周期管理
347
+ │ ├── main_window.py # QWebEngineView 容器 + BackendAPI 桥接
348
+ │ ├── web_api.py # Python↔JS 双向桥接(QWebChannel)
349
+ │ ├── secrets.py # API Key 加密存储
350
+ │ ├── web/ # HTML/CSS/JS 前端
351
+ │ │ ├── index.html # 设置面板页面
352
+ │ │ ├── style.css # 主题系统(Notion 设计语言)
353
+ │ │ ├── app.js # 前端逻辑与信号处理
354
+ │ │ ├── qwebchannel.js # Qt WebChannel 客户端
355
+ │ │ ├── fonts/ # Inter 字体(400/500/600)
356
+ │ │ └── assets/ # 图标(PNG + ICO)
357
+ │ ├── overlay.py # 悬浮字幕窗口(原生 Qt)
358
+ │ ├── bridge.py # Worker → UI 信号桥
359
+ │ ├── worker.py # 异步翻译 Worker 线程
360
+ │ ├── persistence.py # 设置持久化(JSON)
361
+ │ ├── status.py # 会话状态常量
362
+ │ ├── style.py # 字体加载
363
+ │ └── tray.py # 系统托盘图标和菜单
364
+ ├── src/ # 核心翻译引擎
365
+ │ ├── cli.py # CLI 入口:python -m src
366
+ │ ├── client.py # WebSocket 客户端
367
+ │ ├── config.py # 配置管理
368
+ │ ├── microphone.py # 麦克风采集(自动选择后端)
369
+ │ ├── player.py # 音频播放
370
+ │ ├── protocol.py # Protobuf 协议封装
371
+ │ ├── subtitle.py # 字幕渲染
372
+ │ ├── audio/ # 平台感知设备管理
373
+ │ │ ├── device_manager.py # DeviceManager 协议 + Linux/Windows 实现
374
+ │ │ └── hotplug.py # 设备热插拔检测
375
+ │ └── backends/ # 音频后端
376
+ │ ├── sounddevice_backend.py
377
+ │ └── pyaudio_backend.py
378
+ ├── packaging/ # 打包配置
379
+ │ ├── ClassLiveSubtitle.spec # PyInstaller 规格文件
380
+ │ ├── build.py # 构建脚本
381
+ │ └── package.sh # 打包 zip 脚本
382
+ ├── python_protogen/ # Protobuf 生成代码
383
+ ├── tests/ # 测试(298 个)
384
+ ├── requirements.txt # Python 依赖
385
+ ├── .env.example # API Key 配置模板(CLI 用)
386
+ └── README.md # 本文件
387
+ ```
388
+
389
+ ---
390
+
391
+ ## 技术说明
392
+
393
+ 本项目基于火山引擎 [同声传译 2.0 API](https://www.volcengine.com/docs/6561/1756902) 实现,使用 WebSocket + Protobuf 协议与 AST 服务通信。
394
+
395
+ 音频格式:16kHz 采样率、16bit 采样精度、单声道 PCM,80ms 分包。
396
+ GUI 框架:PySide6 (Qt),设置面板使用 QWebEngine + HTML/CSS/JS,悬浮字幕使用原生 Qt。打包:PyInstaller onefile。
@@ -0,0 +1,35 @@
1
+ python_protogen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ python_protogen/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ python_protogen/common/events_pb2.py,sha256=6nspWQenzT_3GPnY5g4XpvLZSZqbIaKm75hGQXDPwcg,3425
4
+ python_protogen/common/events_pb2_grpc.py,sha256=xl9P1v0gC396bS9EPISRNXau4dsOjDuql2tXIXC-dO4,893
5
+ python_protogen/common/rpcmeta_pb2.py,sha256=Fpx53M9HgtyigBQ8ZQgcQFQguoC3GQnZ0nd0M-W7UlE,2650
6
+ python_protogen/common/rpcmeta_pb2_grpc.py,sha256=iVQuEkRv_W5rHg0q73LZZPrRksoDxCTNlZyf_eUCPZw,894
7
+ python_protogen/products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ python_protogen/products/understanding/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ python_protogen/products/understanding/ast/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ python_protogen/products/understanding/ast/ast_service_pb2.py,sha256=_4No67Lu28UNu9kiDrf_yj0LW0g9h6hGe158eG1asGw,3539
11
+ python_protogen/products/understanding/ast/ast_service_pb2_grpc.py,sha256=4NYLtYJvv-3mzXNyEPskFDT1FwFmeYlruaPYPZl4wKc,3864
12
+ python_protogen/products/understanding/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ python_protogen/products/understanding/base/au_base_pb2.py,sha256=Vv-mfmM5KXr6antQIQsfhFZCMJgPdSrCnOqjkWw00r4,11882
14
+ python_protogen/products/understanding/base/au_base_pb2_grpc.py,sha256=RI3UcOJlJkKvMfuHRzfpyt09r9mWTJwcSzqdl143y6o,915
15
+ src/__init__.py,sha256=bg1QH2VXOP7aWa2EXK_6HKVUTQiETHR8qvhVidTFkMo,44
16
+ src/__main__.py,sha256=8x45GqVWcEGoEn1rFKM-KBEWTkf2DCK5m_1D9gNyatw,122
17
+ src/cli.py,sha256=raNppFWy6PtMZX-AmngFZ28CBjSiqaC_vsrQmQVtScI,5831
18
+ src/client.py,sha256=PizFv96xfMjdnAeCKLNC6WmZHCb6FCsV87WqPFnRA6w,5555
19
+ src/config.py,sha256=CWoKAfwCLsgDXGUbpKjlgEpGSKeZ_YVxCixzMeZ-hTI,4428
20
+ src/microphone.py,sha256=Cfi4DPkJ-b6st-eDLdxtcYJDZEKeQWaP5ygIMF7dXGI,2848
21
+ src/player.py,sha256=LJiZ838POd-YflS259WyhLtNfUBSMsxGDF8tdvALdPQ,1430
22
+ src/protocol.py,sha256=APCQi2S_kHy7NpecfTClrcycFCe6rpvc336ONy_qUUo,3441
23
+ src/subtitle.py,sha256=kUQibcBEjKPWk4jQ_RFAOW8-r78PE6Ky62TLYyplCA4,1879
24
+ src/audio/__init__.py,sha256=2Wo6MP3E2UZ36incI5QatKck210W8s0BVtECOmjiFkI,670
25
+ src/audio/device_manager.py,sha256=Mwk1WWn3RqzzX3Q2PY4lKi2c_0qKmj1U3Ih9s_tmdJw,6554
26
+ src/audio/hotplug.py,sha256=kDYGjjOnPRAac4TbdkmeVM3vDpsLuU6fz3SW3vgmF1c,2064
27
+ src/backends/__init__.py,sha256=oCd9ABk7kkfRfrvUQ5yF02MHUdOpR7pwmCmMFEn_EU4,1237
28
+ src/backends/base.py,sha256=cDlgia3wCHOYb2a1obrjh5Thukz6idd8TSeLdC763Tk,2562
29
+ src/backends/pyaudio_backend.py,sha256=bOy-12Ae4ofnivVQyKnpcbCuAah9vQVk8eIZ472cja8,5765
30
+ src/backends/sounddevice_backend.py,sha256=jZux8cj0QLECALvW_doaiBakg3d_IzJMh2mjygeHFrs,4940
31
+ classlivesubtitle-1.0.0.dist-info/METADATA,sha256=OA9K8WmBZ3a5NfMZlfblP2eVA5LIUAXg4jGhPyqvoyM,13453
32
+ classlivesubtitle-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
33
+ classlivesubtitle-1.0.0.dist-info/entry_points.txt,sha256=oGpRCpTrSJXMX8CWiJgeKp6wXC_t_At7JwgJq6Dt-1Y,51
34
+ classlivesubtitle-1.0.0.dist-info/top_level.txt,sha256=hYVpVdI3HyyIcJ7G54nw8Y1AL4muhlG6tlx9d_wAt28,20
35
+ classlivesubtitle-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ classlivesubtitle = src.cli:main
@@ -0,0 +1,2 @@
1
+ python_protogen
2
+ src
File without changes
File without changes
@@ -0,0 +1,38 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: common/events.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'common/events.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x63ommon/events.proto\x12\x11\x64\x61ta.speech.event*\xbf\x08\n\x04Type\x12\x08\n\x04None\x10\x00\x12\x13\n\x0fStartConnection\x10\x01\x12\r\n\tStartTask\x10\x01\x12\x14\n\x10\x46inishConnection\x10\x02\x12\x0e\n\nFinishTask\x10\x02\x12\x15\n\x11\x43onnectionStarted\x10\x32\x12\x0f\n\x0bTaskStarted\x10\x32\x12\x14\n\x10\x43onnectionFailed\x10\x33\x12\x0e\n\nTaskFailed\x10\x33\x12\x16\n\x12\x43onnectionFinished\x10\x34\x12\x10\n\x0cTaskFinished\x10\x34\x12\x10\n\x0cStartSession\x10\x64\x12\x11\n\rCancelSession\x10\x65\x12\x11\n\rFinishSession\x10\x66\x12\x13\n\x0eSessionStarted\x10\x96\x01\x12\x14\n\x0fSessionCanceled\x10\x97\x01\x12\x14\n\x0fSessionFinished\x10\x98\x01\x12\x12\n\rSessionFailed\x10\x99\x01\x12\x12\n\rUsageResponse\x10\x9a\x01\x12\x0f\n\nChargeData\x10\x9a\x01\x12\x10\n\x0bTaskRequest\x10\xc8\x01\x12\x11\n\x0cUpdateConfig\x10\xc9\x01\x12\x11\n\x0cImageRequest\x10\xca\x01\x12\x0f\n\nAudioMuted\x10\xfa\x01\x12\r\n\x08SayHello\x10\xac\x02\x12\x15\n\x10TTSSentenceStart\x10\xde\x02\x12\x13\n\x0eTTSSentenceEnd\x10\xdf\x02\x12\x10\n\x0bTTSResponse\x10\xe0\x02\x12\r\n\x08TTSEnded\x10\xe7\x02\x12\x16\n\x11PodcastRoundStart\x10\xe8\x02\x12\x19\n\x14PodcastRoundResponse\x10\xe9\x02\x12\x14\n\x0fPodcastRoundEnd\x10\xea\x02\x12\x0c\n\x07\x41SRInfo\x10\xc2\x03\x12\x10\n\x0b\x41SRResponse\x10\xc3\x03\x12\r\n\x08\x41SREnded\x10\xcb\x03\x12\x10\n\x0b\x43hatTTSText\x10\xf4\x03\x12\x12\n\rChatTextQuery\x10\xf5\x03\x12\x11\n\x0c\x43hatResponse\x10\xa6\x04\x12\x11\n\x0c\x43himeInStart\x10\xa7\x04\x12\x0f\n\nChimeInEnd\x10\xa8\x04\x12\x0e\n\tChatEnded\x10\xaf\x04\x12\x0f\n\nThinkStart\x10\xb0\x04\x12\x12\n\rThinkResponse\x10\xb1\x04\x12\r\n\x08ThinkEnd\x10\xb2\x04\x12\x0f\n\nToolOutput\x10\xb3\x04\x12\x14\n\x0f\x46\x43ResponseStart\x10\xb4\x04\x12\x0f\n\nFCResponse\x10\xb5\x04\x12\x12\n\rFCResponseEnd\x10\xb6\x04\x12\x18\n\x13SourceSubtitleStart\x10\x8a\x05\x12\x1b\n\x16SourceSubtitleResponse\x10\x8b\x05\x12\x16\n\x11SourceSubtitleEnd\x10\x8c\x05\x12\x1d\n\x18TranslationSubtitleStart\x10\x8d\x05\x12 \n\x1bTranslationSubtitleResponse\x10\x8e\x05\x12\x1b\n\x16TranslationSubtitleEnd\x10\x8f\x05\x1a\x02\x10\x01\x62\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common.events_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_TYPE']._loaded_options = None
35
+ _globals['_TYPE']._serialized_options = b'\020\001'
36
+ _globals['_TYPE']._serialized_start=43
37
+ _globals['_TYPE']._serialized_end=1130
38
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,24 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+
7
+ GRPC_GENERATED_VERSION = '1.76.0'
8
+ GRPC_VERSION = grpc.__version__
9
+ _version_not_supported = False
10
+
11
+ try:
12
+ from grpc._utilities import first_version_is_lower
13
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
14
+ except ImportError:
15
+ _version_not_supported = True
16
+
17
+ if _version_not_supported:
18
+ raise RuntimeError(
19
+ f'The grpc package installed is at version {GRPC_VERSION},'
20
+ + ' but the generated code in common/events_pb2_grpc.py depends on'
21
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
22
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
23
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
24
+ )
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: common/rpcmeta.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'common/rpcmeta.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x63ommon/rpcmeta.proto\x12\x12\x64\x61ta.speech.common\"\xda\x01\n\x0bRequestMeta\x12\x1a\n\x08\x45ndpoint\x18\x01 \x01(\tR\x08\x65ndpoint\x12\x17\n\x06\x41ppKey\x18\x02 \x01(\tR\x07\x61pp_key\x12\x15\n\x05\x41ppID\x18\x03 \x01(\tR\x06\x61pp_id\x12\x1f\n\nResourceID\x18\x04 \x01(\tR\x0bresource_id\x12#\n\x0c\x43onnectionID\x18\x05 \x01(\tR\rconnection_id\x12\x1d\n\tSessionID\x18\x06 \x01(\tR\nsession_id\x12\x1a\n\x08Sequence\x18\x07 \x01(\x05R\x08sequence\"=\n\x0b\x42illingItem\x12\x12\n\x04Unit\x18\x01 \x01(\tR\x04unit\x12\x1a\n\x08Quantity\x18\x02 \x01(\x02R\x08quantity\"\x84\x01\n\x07\x42illing\x12\x35\n\x05Items\x18\x01 \x03(\x0b\x32\x1f.data.speech.common.BillingItemR\x05items\x12#\n\x0c\x44urationMsec\x18\x02 \x01(\x03R\rduration_msec\x12\x1d\n\tWordCount\x18\x03 \x01(\x03R\nword_count\"\xcc\x01\n\x0cResponseMeta\x12\x1d\n\tSessionID\x18\x01 \x01(\tR\nsession_id\x12\x1a\n\x08Sequence\x18\x02 \x01(\x05R\x08sequence\x12\x1f\n\nStatusCode\x18\x03 \x01(\x05R\x0bstatus_code\x12\x18\n\x07Message\x18\x04 \x01(\tR\x07message\x12:\n\x07\x42illing\x18\x05 \x01(\x0b\x32\x1b.data.speech.common.BillingH\x00R\x07\x62illing\x88\x01\x01\x42\n\n\x08_Billingb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common.rpcmeta_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_REQUESTMETA']._serialized_start=45
35
+ _globals['_REQUESTMETA']._serialized_end=263
36
+ _globals['_BILLINGITEM']._serialized_start=265
37
+ _globals['_BILLINGITEM']._serialized_end=326
38
+ _globals['_BILLING']._serialized_start=329
39
+ _globals['_BILLING']._serialized_end=461
40
+ _globals['_RESPONSEMETA']._serialized_start=464
41
+ _globals['_RESPONSEMETA']._serialized_end=668
42
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,24 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+
7
+ GRPC_GENERATED_VERSION = '1.76.0'
8
+ GRPC_VERSION = grpc.__version__
9
+ _version_not_supported = False
10
+
11
+ try:
12
+ from grpc._utilities import first_version_is_lower
13
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
14
+ except ImportError:
15
+ _version_not_supported = True
16
+
17
+ if _version_not_supported:
18
+ raise RuntimeError(
19
+ f'The grpc package installed is at version {GRPC_VERSION},'
20
+ + ' but the generated code in common/rpcmeta_pb2_grpc.py depends on'
21
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
22
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
23
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
24
+ )
File without changes
File without changes
File without changes
@@ -0,0 +1,45 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: products/understanding/ast/ast_service.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'products/understanding/ast/ast_service.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from python_protogen.common import events_pb2 as common_dot_events__pb2
26
+ from python_protogen.common import rpcmeta_pb2 as common_dot_rpcmeta__pb2
27
+ from python_protogen.products.understanding.base import au_base_pb2 as products_dot_understanding_dot_base_dot_au__base__pb2
28
+
29
+
30
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,products/understanding/ast/ast_service.proto\x12\x0f\x64\x61ta.speech.ast\x1a\x13\x63ommon/events.proto\x1a\x14\x63ommon/rpcmeta.proto\x1a)products/understanding/base/au_base.proto\"\xa7\x01\n\tReqParams\x12\x0c\n\x04mode\x18\x01 \x01(\t\x12\x17\n\x0fsource_language\x18\x02 \x01(\t\x12\x17\n\x0ftarget_language\x18\x03 \x01(\t\x12\x12\n\nspeaker_id\x18\x04 \x01(\t\x12\x13\n\x0bspeech_rate\x18\x05 \x01(\x05\x12\x31\n\x06\x63orpus\x18\x64 \x01(\x0b\x32!.data.speech.understanding.Corpus\"\xf5\x02\n\x10TranslateRequest\x12:\n\x0crequest_meta\x18\x01 \x01(\x0b\x32\x1f.data.speech.common.RequestMetaH\x00\x88\x01\x01\x12&\n\x05\x65vent\x18\x02 \x01(\x0e\x32\x17.data.speech.event.Type\x12-\n\x04user\x18\x03 \x01(\x0b\x32\x1f.data.speech.understanding.User\x12\x36\n\x0csource_audio\x18\x04 \x01(\x0b\x32 .data.speech.understanding.Audio\x12\x36\n\x0ctarget_audio\x18\x05 \x01(\x0b\x32 .data.speech.understanding.Audio\x12+\n\x07request\x18\x06 \x01(\x0b\x32\x1a.data.speech.ast.ReqParams\x12\x14\n\x07\x64\x65noise\x18\x07 \x01(\x08H\x01\x88\x01\x01\x42\x0f\n\r_request_metaB\n\n\x08_denoise\"\xf9\x01\n\x11TranslateResponse\x12<\n\rresponse_meta\x18\x01 \x01(\x0b\x32 .data.speech.common.ResponseMetaH\x00\x88\x01\x01\x12&\n\x05\x65vent\x18\x02 \x01(\x0e\x32\x17.data.speech.event.Type\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\x0c\n\x04text\x18\x04 \x01(\t\x12\x12\n\nstart_time\x18\x05 \x01(\x05\x12\x10\n\x08\x65nd_time\x18\x06 \x01(\x05\x12\x0f\n\x07spk_chg\x18\x07 \x01(\x08\x12\x19\n\x11muted_duration_ms\x18\x08 \x01(\x05\x42\x10\n\x0e_response_meta2d\n\nASTService\x12V\n\tTranslate\x12!.data.speech.ast.TranslateRequest\x1a\".data.speech.ast.TranslateResponse(\x01\x30\x01\x62\x06proto3')
31
+
32
+ _globals = globals()
33
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
34
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'products.understanding.ast.ast_service_pb2', _globals)
35
+ if not _descriptor._USE_C_DESCRIPTORS:
36
+ DESCRIPTOR._loaded_options = None
37
+ _globals['_REQPARAMS']._serialized_start=152
38
+ _globals['_REQPARAMS']._serialized_end=319
39
+ _globals['_TRANSLATEREQUEST']._serialized_start=322
40
+ _globals['_TRANSLATEREQUEST']._serialized_end=695
41
+ _globals['_TRANSLATERESPONSE']._serialized_start=698
42
+ _globals['_TRANSLATERESPONSE']._serialized_end=947
43
+ _globals['_ASTSERVICE']._serialized_start=949
44
+ _globals['_ASTSERVICE']._serialized_end=1049
45
+ # @@protoc_insertion_point(module_scope)