Skip to content

Commit

Permalink
add missing queue task_done()
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed May 16, 2024
1 parent e07d431 commit 935eb08
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipecat/frames/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class TextFrame(DataFrame):
text: str

def __str__(self):
return f'{self.name}: "{self.text}"'
return f"{self.name}(text: {self.text})"


@dataclass
Expand All @@ -132,7 +132,7 @@ class TranscriptionFrame(TextFrame):
timestamp: str

def __str__(self):
return f"{self.name}(user: {self.user_id}, timestamp: {self.timestamp})"
return f"{self.name}(user: {self.user_id}, text: {self.text}, timestamp: {self.timestamp})"


@dataclass
Expand All @@ -143,7 +143,7 @@ class InterimTranscriptionFrame(TextFrame):
timestamp: str

def __str__(self):
return f"{self.name}(user: {self.user_id}, timestamp: {self.timestamp})"
return f"{self.name}(user: {self.user_id}, text: {self.text}, timestamp: {self.timestamp})"


@dataclass
Expand Down
2 changes: 2 additions & 0 deletions src/pipecat/transports/base_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def _audio_out_thread_handler(self):
future = asyncio.run_coroutine_threadsafe(
self.push_frame(frame), self.get_event_loop())
future.result()

self._audio_in_queue.task_done()
except queue.Empty:
pass
except BaseException as e:
Expand Down
3 changes: 3 additions & 0 deletions src/pipecat/transports/base_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def _sink_thread_handler(self):
# Send any remaining audio
self._send_audio_truncated(buffer, bytes_size_10ms)
buffer = bytearray()

self._sink_queue.task_done()
except queue.Empty:
pass
except BaseException as e:
Expand Down Expand Up @@ -208,6 +210,7 @@ def _camera_out_thread_handler(self):
if self._params.camera_out_is_live:
image = self._camera_out_queue.get(timeout=1)
self._draw_image(image)
self._camera_out_queue.task_done()
elif self._camera_images:
image = next(self._camera_images)
self._draw_image(image)
Expand Down

0 comments on commit 935eb08

Please sign in to comment.