diff --git a/src/pipecat/processors/async_frame_processor.py b/src/pipecat/processors/async_frame_processor.py index 24c016867..28a27d255 100644 --- a/src/pipecat/processors/async_frame_processor.py +++ b/src/pipecat/processors/async_frame_processor.py @@ -59,5 +59,6 @@ class AsyncFrameProcessor(FrameProcessor): (frame, direction) = await self._push_queue.get() await self.push_frame(frame, direction) running = not isinstance(frame, EndFrame) + self._push_queue.task_done() except asyncio.CancelledError: break diff --git a/src/pipecat/processors/frameworks/rtvi.py b/src/pipecat/processors/frameworks/rtvi.py index 1143499a2..37142e2d3 100644 --- a/src/pipecat/processors/frameworks/rtvi.py +++ b/src/pipecat/processors/frameworks/rtvi.py @@ -316,6 +316,7 @@ class RTVIProcessor(FrameProcessor): try: (frame, direction) = await self._frame_queue.get() await self._handle_frame(frame, direction) + self._frame_queue.task_done() except asyncio.CancelledError: break diff --git a/src/pipecat/services/cartesia.py b/src/pipecat/services/cartesia.py index c672121be..367d0c400 100644 --- a/src/pipecat/services/cartesia.py +++ b/src/pipecat/services/cartesia.py @@ -114,9 +114,11 @@ class CartesiaTTSService(TTSService): try: if self._context_appending_task: self._context_appending_task.cancel() + await self._context_appending_task self._context_appending_task = None if self._receive_task: self._receive_task.cancel() + await self._receive_task self._receive_task = None if self._websocket: ws = self._websocket diff --git a/src/pipecat/transports/base_input.py b/src/pipecat/transports/base_input.py index f87772c01..c0a13d1ce 100644 --- a/src/pipecat/transports/base_input.py +++ b/src/pipecat/transports/base_input.py @@ -104,6 +104,7 @@ class BaseInputTransport(FrameProcessor): try: (frame, direction) = await self._push_queue.get() await self.push_frame(frame, direction) + self._push_queue.task_done() except asyncio.CancelledError: break @@ -185,6 +186,8 @@ class BaseInputTransport(FrameProcessor): # Push audio downstream if passthrough. if audio_passthrough: await self._internal_push_frame(frame) + + self._audio_in_queue.task_done() except asyncio.CancelledError: break except Exception as e: diff --git a/src/pipecat/transports/base_output.py b/src/pipecat/transports/base_output.py index 41f2df79e..355008f89 100644 --- a/src/pipecat/transports/base_output.py +++ b/src/pipecat/transports/base_output.py @@ -204,6 +204,7 @@ class BaseOutputTransport(FrameProcessor): try: (frame, direction) = await self._push_queue.get() await self.push_frame(frame, direction) + self._push_queue.task_done() except asyncio.CancelledError: break