diff --git a/src/dailyai/services/azure_ai_services.py b/src/dailyai/services/azure_ai_services.py index cf5ba2898..907b33c83 100644 --- a/src/dailyai/services/azure_ai_services.py +++ b/src/dailyai/services/azure_ai_services.py @@ -84,7 +84,7 @@ class AzureLLMService(LLMService): messages_for_log = json.dumps(messages) self.logger.debug(f"Generating chat via azure: {messages_for_log}") - response = self.get_response(messages, stream=False) + response = await asyncio.to_thread(self.get_response, messages, False) if response and len(response.choices) > 0: return response.choices[0].message.content else: diff --git a/src/dailyai/services/daily_transport_service.py b/src/dailyai/services/daily_transport_service.py index dc7e7c0ae..92a325d84 100644 --- a/src/dailyai/services/daily_transport_service.py +++ b/src/dailyai/services/daily_transport_service.py @@ -212,11 +212,13 @@ class DailyTransportService(EventHandler): try: while not self.stop_threads.is_set(): if self.image: + print("rendering image") self.camera.write_frame(self.image) - time.sleep(1.0 / 8.0) # 8 fps + time.sleep(1.0 / 24) # 24 fps except Exception as e: self.logger.error(f"Exception {e} in camera thread.") + print("exiting run_camera thread") def frame_consumer(self): self.logger.info("🎬 Starting frame consumer thread") diff --git a/src/samples/05-sync-speech-and-text.py b/src/samples/05-sync-speech-and-text.py index 1c04acc96..456a89954 100644 --- a/src/samples/05-sync-speech-and-text.py +++ b/src/samples/05-sync-speech-and-text.py @@ -29,7 +29,7 @@ async def main(room_url, token): async def get_all_audio(text): all_audio = bytearray() async for audio in tts.run_tts(text): - all_audio.append(audio) + all_audio.extend(audio) return all_audio @@ -48,7 +48,7 @@ async def main(room_url, token): (image, audio) = await asyncio.gather( *[dalle.run_image_gen(inference_text, "1024x1024"), get_all_audio(inference_text)] ) - print(f"Got audio and video for {month}") + print(f"Got audio and video for {month}", image[0]) transport.output_queue.put( [ OutputQueueFrame(FrameType.IMAGE_FRAME, image[1]), @@ -70,9 +70,18 @@ async def main(room_url, token): "September", "October", "November", + "December" ] + sleeper = asyncio.sleep(meeting_duration_minutes * 60) + print("gathering") await asyncio.gather(*[show_month(month) for month in months]) + print("waiting") + await sleeper + print("done") + except Exception as e: + print("Exception", e) finally: + print("finally") transport.stop() print("Done")