From ee9cce64b2b78d99129e522cf6daeb31aa062aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 6 Feb 2025 07:40:03 -0800 Subject: [PATCH] BaseInputTransport: show VAD results when interruptions not allowed --- src/pipecat/transports/base_input.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pipecat/transports/base_input.py b/src/pipecat/transports/base_input.py index b18776fa8..e5e8b344c 100644 --- a/src/pipecat/transports/base_input.py +++ b/src/pipecat/transports/base_input.py @@ -130,17 +130,18 @@ class BaseInputTransport(FrameProcessor): # async def _handle_interruptions(self, frame: Frame): - if self.interruptions_allowed: + if isinstance(frame, UserStartedSpeakingFrame): + logger.debug("User started speaking") # Make sure we notify about interruptions quickly out-of-band. - if isinstance(frame, UserStartedSpeakingFrame): - logger.debug("User started speaking") + if self.interruptions_allowed: await self._start_interruption() # Push an out-of-band frame (i.e. not using the ordered push # frame task) to stop everything, specially at the output # transport. await self.push_frame(StartInterruptionFrame()) - elif isinstance(frame, UserStoppedSpeakingFrame): - logger.debug("User stopped speaking") + elif isinstance(frame, UserStoppedSpeakingFrame): + logger.debug("User stopped speaking") + if self.interruptions_allowed: await self._stop_interruption() await self.push_frame(StopInterruptionFrame())