From 989252bb52238c2f41ac1a4e2a48a8e59f3dd6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 9 Apr 2024 14:56:41 -0700 Subject: [PATCH] daily: always check camera/mic/speaker enabled --- src/dailyai/transports/daily_transport.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dailyai/transports/daily_transport.py b/src/dailyai/transports/daily_transport.py index d48f9d8ed..8eb23d23b 100644 --- a/src/dailyai/transports/daily_transport.py +++ b/src/dailyai/transports/daily_transport.py @@ -162,16 +162,20 @@ def decorator(handler): return decorator def write_frame_to_camera(self, frame: bytes): - self.camera.write_frame(frame) + if self._camera_enabled: + self.camera.write_frame(frame) def write_frame_to_mic(self, frame: bytes): - self.mic.write_frames(frame) + if self._mic_enabled: + self.mic.write_frames(frame) def send_app_message(self, message: Any, participantId: str | None): self.client.send_app_message(message, participantId) def read_audio_frames(self, desired_frame_count): - bytes = self._speaker.read_frames(desired_frame_count) + bytes = b"" + if self._speaker_enabled or self._vad_enabled: + bytes = self._speaker.read_frames(desired_frame_count) return bytes def _prerun(self):