From 83b0dc39f715f350e2509171cabff910d7805885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 15 Oct 2025 09:22:48 -0700 Subject: [PATCH] BaseInputTransport: stop audio filter on cancel --- CHANGELOG.md | 3 +++ src/pipecat/transports/base_input.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 424d6a420..aaaf0b54c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue where audio filters' `stop()` would not be called when using + `CancelFrame`. + - Fixed an issue where `RimeHttpTTSService` and `PiperTTSService` could generate incorrectly 16-bit aligned audio frames, potentially leading to internal errors or static audio. diff --git a/src/pipecat/transports/base_input.py b/src/pipecat/transports/base_input.py index 25cc56f68..0f247c6dc 100644 --- a/src/pipecat/transports/base_input.py +++ b/src/pipecat/transports/base_input.py @@ -232,6 +232,9 @@ class BaseInputTransport(FrameProcessor): """ # Cancel and wait for the audio input task to finish. await self._cancel_audio_task() + # Stop audio filter. + if self._params.audio_in_filter: + await self._params.audio_in_filter.stop() async def set_transport_ready(self, frame: StartFrame): """Called when the transport is ready to stream.