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