From a4acc12f91d6ece7c3ec608973a311609d1d393f Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Sat, 24 Jan 2026 18:26:34 -0500 Subject: [PATCH] Align Speechmatics STT TTFB metrics with STT classes --- src/pipecat/services/speechmatics/stt.py | 26 ------------------------ 1 file changed, 26 deletions(-) diff --git a/src/pipecat/services/speechmatics/stt.py b/src/pipecat/services/speechmatics/stt.py index 457388c31..d12b2a7d3 100644 --- a/src/pipecat/services/speechmatics/stt.py +++ b/src/pipecat/services/speechmatics/stt.py @@ -8,7 +8,6 @@ import asyncio import os -import time from enum import Enum from typing import Any, AsyncGenerator @@ -598,9 +597,6 @@ class SpeechmaticsSTTService(STTService): if segments: await self._send_frames(segments) - # Update metrics - await self._emit_metrics(message.get("metadata", {}).get("processing_time", 0.0)) - async def _handle_segment(self, message: dict[str, Any]) -> None: """Handle AddSegment events. @@ -804,28 +800,6 @@ class SpeechmaticsSTTService(STTService): yield ErrorFrame(f"Speechmatics error: {e}") await self._disconnect() - async def _emit_metrics(self, processing_time: float) -> None: - """Create TTFB metrics. - - The TTFB is the seconds between the person speaking and the STT - engine emitting the first partial. This is only calculated at the - start of an utterance. - """ - # Skip if metrics not available - if not self._metrics or processing_time == 0.0: - return - - # Calculate time as time.time() - ttfb (which is seconds) - start_time = time.time() - processing_time - - # Update internal metrics - self._metrics._start_ttfb_time = start_time - self._metrics._start_processing_time = start_time - - # Stop TTFB metrics - await self.stop_ttfb_metrics() - await self.stop_processing_metrics() - # ============================================================================ # HELPERS # ============================================================================