transports(daily): avoid locking if no participant has joined yet
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user