在 TOKEN 流模式下,TTSSpeakFrame 文本的 TTS 使用量度会丢失: InterruptionFrame 在清空之前会丢弃 _streamed_text
作者: mannyb223创建于 2026年9月3日更新于 2026年9月18日
问题:
当 TTSService 的子类在 TextAggregationMode.TOKEN 模式下运行(DeepgramFluxTTSBase 和任何其他 token 流式 TTS 服务的默认模式),start_tts_usage_metrics 为每个调用都是一个无操作(tts_service.py:436-447 — if self._is_streaming_tokens: return)。使用量实际上被累积到 self._streamed_text 中,在 _push_tts_frames 中(tts_service.py:1183-1185),并且只有在 LLMFullResponseEndFrame 或 EndFrame 到达 process_frame(tts_service.py:788, 818-821)时才会被刷新到真正的 TTSUsageMetricsData/MetricsFrame 中。
内容来源: pipecat-ai/pipecat