Fix 06a-image-sync.py
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import argparse
|
||||
import asyncio
|
||||
import os
|
||||
from typing import AsyncGenerator
|
||||
import aiohttp
|
||||
import requests
|
||||
import time
|
||||
import urllib.parse
|
||||
@@ -30,10 +32,7 @@ class ImageSyncAggregator(AIService):
|
||||
|
||||
|
||||
async def main(room_url: str, token):
|
||||
global transport
|
||||
global llm
|
||||
global tts
|
||||
|
||||
async with aiohttp.ClientSession() as aiohttp_session:
|
||||
transport = DailyTransportService(
|
||||
room_url,
|
||||
token,
|
||||
@@ -48,7 +47,7 @@ async def main(room_url: str, token):
|
||||
|
||||
llm = AzureLLMService()
|
||||
tts = AzureTTSService()
|
||||
img = FalImageGenService(image_size="1024x1024")
|
||||
img = FalImageGenService(image_size="1024x1024", aiohttp_session=aiohttp_session)
|
||||
|
||||
async def get_images():
|
||||
get_speaking_task = asyncio.create_task(
|
||||
@@ -80,8 +79,8 @@ async def main(room_url: str, token):
|
||||
messages, transport.my_participant_id
|
||||
)
|
||||
image_sync_aggregator = ImageSyncAggregator(
|
||||
"/Users/moishe/src/daily-ai-sdk/src/samples/foundational/speaking.png",
|
||||
"/Users/moishe/src/daily-ai-sdk/src/samples/foundational/waiting.png",
|
||||
os.path.join(os.path.dirname(__file__), "images", "speaking.png"),
|
||||
os.path.join(os.path.dirname(__file__), "images", "waiting.png"),
|
||||
)
|
||||
await tts.run_to_queue(
|
||||
transport.send_queue,
|
||||
|
||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user