feat(ui): add floating caption window with live transcription

Add a frameless always-on-top caption window wired to the live capture
pipeline. Silence-based segmentation gates the audio so the model never
sees silence, and the panel background is painted in paintEvent with a
configurable opacity instead of a style sheet.

新增悬浮字幕窗(无边框、置顶、可折叠/展开),接入实时采集与流式转写。
分段由静音检测驱动,静音期间不送音频,避免模型对静音产生幻觉。底板
改为在 paintEvent 中绘制,不透明度可调。
This commit is contained in:
blumia committed 2026-10-12 13:32:16 +08:00
1 parent 21d68e2294
commit 4ed4e23282
14 files changed
+803 -259

No files matched your search

+3 -1
View File
@@ -37,6 +37,7 @@ public:
int chunkIndex = 0;
std::string language;
std::string committed; // 稳定部分
std::string tail; // 不稳定尾部(committed 之后的部分)
std::string full; // 含不稳定尾部
std::string rawFull; // 未 trim 的完整文本(含 language 头)
double windowSeconds = 0.0;
@@ -51,7 +52,8 @@ public:
// 喂入 16k 单声道音频;每凑够 chunkSec 就跑一步并回调
void feed(const float * pcm, size_t n, const std::function<void(const Step &)> & onStep);
// 处理不足一块的残留音频,并作为最后一步提交全部文本
// 处理不足一块的残留音频,并作为最后一步提交全部文本。
// 若没有待处理音频,也把当前已稳定文本提交为最终(静音分段时会用到)。
void flush(const std::function<void(const Step &)> & onStep);
// 结束当前这段(例如检测到静音):清空 KV 与状态,下一段重新开始