diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cdc8420..f96a80275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed an issue in `DailyTransport` that would not allow the processor to + shutdown if no participant ever joined the room. + - Fixed transport start and stop. In some situation processors would halt or not shutdown properly. diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index fc29fa81d..b280ee4d8 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -182,7 +182,14 @@ class DailyTransportClient(EventHandler): self._client.send_app_message(frame.message, frame.participant_id) def read_raw_audio_frames(self, frame_count: int) -> bytes: - return self._speaker.read_frames(frame_count) + if self._other_participant_has_joined: + return self._speaker.read_frames(frame_count) + else: + # If no one has ever joined the meeting `read_frames()` would block, + # instead we just wait a bit. daily-python should probably return + # silence instead. + time.sleep(0.01) + return b'' def write_raw_audio_frames(self, frames: bytes): self._mic.write_frames(frames)