fix(tts): gate auto reply by ENABLE_TTS; allow on-demand and manual playback

- Pipeline: skip _send_tts_audio only for non-manual when ENABLE_TTS=false;
  remove enable_tts early return from handle_tts_request_on_demand.
- Tencent TTS: PrimaryLanguage/chunking follow user language preference only.
- Expo: let manual tts_audio bypass late-segment playback gate after interrupt.
- Docs: clarify ENABLE_TTS vs tts_request in api/.env.example and TTSProvider port.
- Tests: add manual bypass cases; adjust pipeline language tests for en+Chinese text.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin
2026-05-11 17:15:02 +08:00
parent ccdc4e4277
commit 93be60f74c
7 changed files with 101 additions and 17 deletions

View File

@@ -1238,7 +1238,10 @@ export default function ConversationScreen() {
const handleTtsSegment = useCallback(
(p: TtsSegmentPayload) => {
if (!ttsGate.current.shouldAcceptIncomingTts()) return;
// 闸门用于丢弃「用户已打断后」迟到的自动 TTS按需朗读 (manual) 是当前明确操作,必须放行。
const allowByGate =
p.manual === true || ttsGate.current.shouldAcceptIncomingTts();
if (!allowByGate) return;
const convId = id ?? '';
const cosUrl = p.audioUrl?.trim();
/**