Skip to content

Commit

Permalink
daily: always check camera/mic/speaker enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aconchillo committed Apr 10, 2024
1 parent 4bd29b0 commit 989252b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/dailyai/transports/daily_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 989252b

Please sign in to comment.