From 3e05be48d6bab400a56d4988a9a95518e47bf164 Mon Sep 17 00:00:00 2001 From: Rodger-Wang <1367893453@qq.com> Date: Tue, 22 Sep 2026 19:01:09 +0800 Subject: [PATCH] =?UTF-8?q?client:=20=E9=80=9A=E8=AF=9D=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E4=B8=8B=E8=A1=8C=E8=BF=BD=E8=B5=B6=E5=8F=82=E6=95=B0=E6=94=B6?= =?UTF-8?q?=E7=B4=A7=EF=BC=88=E4=B8=A4=E7=AB=AF=E5=90=8C=E6=94=B9=EF=BC=89?= =?UTF-8?q?=EF=BC=9A1s=20=E8=B5=B7=E5=8F=98=E9=80=9F=E3=80=812.5s=20?= =?UTF-8?q?=E8=BE=BE=201.3x=E3=80=810.5s=20=E8=B5=B7=E8=A3=81=E9=9D=99?= =?UTF-8?q?=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 四轮压测 + 同一到达轨迹回放对比:>3s 积压累计时长减半、中位降 25%,零丢帧零错误。 峰值由云端单次响应长度决定,参数再收也不降,下一步只能从切句(turn_detection)下手。 CLAUDE.md 记录取舍与数据。 Co-Authored-By: Claude Fable 5.1 --- CLAUDE.md | 5 ++++- .../example/bluetooth_manager/CallTranslationDownlink.kt | 6 +++--- .../Sources/bluetooth_manager/CallTranslationDownlink.swift | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 630cb30e..2ee6b111 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -891,7 +891,10 @@ iPhone 上每次都退出重进测就碰不到,要复现就同页连开两场 译文音频是模型**突发**产出的(每 3~6 秒一段文本,音频一次性到),播放只能 1 倍速;说话人不停顿时 译文时长 ≈ 原话时长(实测 A 路 133 秒会话产出 129 秒音频),下行队列只涨不缩——A 路积压到 **6.2 秒**, 用户说的"越说越慢"就是它。**上行没有积压**(桥峰值 8~12 帧),瓶颈只在 `CallTranslationDownlink`。 -处理两层,都不丢内容:积压 >1s 裁掉超过 150ms 的静音;>2s 起 WSOLA 变速不变调,4s 达 1.3x 上限。 +处理两层,都不丢内容:积压 >0.5s 裁掉超过 150ms 的静音;>1s 起 WSOLA 变速不变调,2.5s 达 1.3x 上限 +(2026-09-22 晚由 1s/2s/4s 收紧而来:同一份到达轨迹回放对比,>3s 积压的累计时长减半、中位降 25%; +峰值不再随参数下降——峰值由云端单次响应的音频长度决定,一句不换气说 28 秒就会砸下 8 秒音频, +再往下只能从切句下手,如 `turn_detection`。1.5x 上限能再减 40% 的 >2s 时长,但语速发急,作为口味项未采用)。 同量压测:最大积压 6.2s → 3.2s,绝大部分时间 <1.5s,**光裁静音就省了 10%**(TTS 句间停顿), 变速最高只用到 1.11x。兜底整段丢弃(`HARD_CAP_SEC`)默认关。 - 参数与算法两端一份(`CallTranslationDownlink.kt` / `.swift`),改一端要同改另一端; diff --git a/apps/client/local_plugins/bluetooth_manager/android/src/main/kotlin/com/example/bluetooth_manager/CallTranslationDownlink.kt b/apps/client/local_plugins/bluetooth_manager/android/src/main/kotlin/com/example/bluetooth_manager/CallTranslationDownlink.kt index e92e03a4..7216e4a5 100644 --- a/apps/client/local_plugins/bluetooth_manager/android/src/main/kotlin/com/example/bluetooth_manager/CallTranslationDownlink.kt +++ b/apps/client/local_plugins/bluetooth_manager/android/src/main/kotlin/com/example/bluetooth_manager/CallTranslationDownlink.kt @@ -59,10 +59,10 @@ object CallTranslationDownlink { private const val PACKET_SIZE = 84 // ---- 追赶策略参数 ---- - private const val CATCHUP_START_SEC = 2.0 - private const val CATCHUP_FULL_SEC = 4.0 + private const val CATCHUP_START_SEC = 1.0 + private const val CATCHUP_FULL_SEC = 2.5 private const val MAX_RATE = 1.3 - private const val SILENCE_TRIM_START_SEC = 1.0 + private const val SILENCE_TRIM_START_SEC = 0.5 private const val SILENCE_KEEP_MS = 150 private const val SILENCE_RMS = 300.0 private const val HARD_CAP_SEC = 0.0 diff --git a/apps/client/local_plugins/bluetooth_manager/ios/bluetooth_manager/Sources/bluetooth_manager/CallTranslationDownlink.swift b/apps/client/local_plugins/bluetooth_manager/ios/bluetooth_manager/Sources/bluetooth_manager/CallTranslationDownlink.swift index bc720777..a54aa3fd 100644 --- a/apps/client/local_plugins/bluetooth_manager/ios/bluetooth_manager/Sources/bluetooth_manager/CallTranslationDownlink.swift +++ b/apps/client/local_plugins/bluetooth_manager/ios/bluetooth_manager/Sources/bluetooth_manager/CallTranslationDownlink.swift @@ -38,10 +38,10 @@ public final class CallTranslationDownlink { private static let packetSize = 84 // ---- 追赶策略参数(与 Android 一致,改一端要同改另一端)---- - private static let catchupStartSec = 2.0 - private static let catchupFullSec = 4.0 + private static let catchupStartSec = 1.0 + private static let catchupFullSec = 2.5 private static let maxRate = 1.3 - private static let silenceTrimStartSec = 1.0 + private static let silenceTrimStartSec = 0.5 private static let silenceKeepMs = 150 private static let silenceRms = 300.0 private static let hardCapSec = 0.0