diff --git a/src/pipecat/transports/base_input.py b/src/pipecat/transports/base_input.py index f3ee492d3..1aa3ceaab 100644 --- a/src/pipecat/transports/base_input.py +++ b/src/pipecat/transports/base_input.py @@ -44,11 +44,15 @@ class BaseInputTransport(FrameProcessor): self._create_push_task() async def start(self, frame: StartFrame): + # Make sure we have the latest params. Note that this transport might + # have been started on another task that might not need interruptions, + # for example. + self._allow_interruptions = frame.allow_interruptions + if self._running: return self._running = True - self._allow_interruptions = frame.allow_interruptions if self._params.audio_in_enabled or self._params.vad_enabled: loop = self.get_event_loop() diff --git a/src/pipecat/transports/base_output.py b/src/pipecat/transports/base_output.py index 7d18f1265..9d6c567b1 100644 --- a/src/pipecat/transports/base_output.py +++ b/src/pipecat/transports/base_output.py @@ -54,11 +54,15 @@ class BaseOutputTransport(FrameProcessor): self._is_interrupted = threading.Event() async def start(self, frame: StartFrame): + # Make sure we have the latest params. Note that this transport might + # have been started on another task that might not need interruptions, + # for example. + self._allow_interruptions = frame.allow_interruptions + if self._running: return self._running = True - self._allow_interruptions = frame.allow_interruptions loop = self.get_event_loop()