From 48d73a263619145159bb05c25d25ce799f960bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 18 Mar 2025 23:53:48 -0700 Subject: [PATCH] SegmentedSTTService: allow audio to pass-through downstream --- CHANGELOG.md | 3 +++ src/pipecat/services/ai_services.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 125ca20d8..5d30759a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,6 +142,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue with `SegmentedSTTService` based services + (e.g. `GroqSTTService`) that was not allow audio to pass-through downstream. + - Fixed a `CartesiaTTSService` and `RimeTTSService` issue that would consider text between spelling out tags end of sentence. diff --git a/src/pipecat/services/ai_services.py b/src/pipecat/services/ai_services.py index eae030b27..ba895c53d 100644 --- a/src/pipecat/services/ai_services.py +++ b/src/pipecat/services/ai_services.py @@ -811,8 +811,6 @@ class STTService(AIService): return await self.process_generator(self.run_stt(frame.audio)) - if self._audio_passthrough: - await self.push_frame(frame, direction) async def process_frame(self, frame: Frame, direction: FrameDirection): """Processes a frame of audio data, either buffering or transcribing it.""" @@ -823,6 +821,8 @@ class STTService(AIService): # push a TextFrame. We also push audio downstream in case someone # else needs it. await self.process_audio_frame(frame, direction) + if self._audio_passthrough: + await self.push_frame(frame, direction) elif isinstance(frame, STTUpdateSettingsFrame): await self._update_settings(frame.settings) elif isinstance(frame, STTMuteFrame):