why isnt audio recording working? import os from ...
# ask-ai
c
why isnt audio recording working? import os from dotenv import load_dotenv from livekit import agents from livekit.agents.voice import AgentSession, Agent from livekit.plugins import openai, silero from livekit import api load_dotenv(".env", override=True) class Assistant(Agent): def ___init___(self) -> _None_: super().___init___(instructions="You are a helpful voice AI assistant. You speak English.") async def entrypoint(ctx: agents.JobContext): req = api.RoomCompositeEgressRequest( room_name="test", audio_only=True, file_outputs=[ api.EncodedFileOutput( file_type=api.EncodedFileType.OGG, filepath="livekit/my-room-test.ogg", s3=api.S3Upload( bucket=os.getenv("AWS_BUCKET_NAME"), region=os.getenv("AWS_REGION"), access_key=os.getenv("AWS_ACCESS_KEY_ID"), secret=os.getenv("AWS_SECRET_ACCESS_KEY"), ), ) ], ) lkapi = api.LiveKitAPI() res = await lkapi.egress.start_room_composite_egress(req) await lkapi.aclose() session = AgentSession(llm=openai.realtime.RealtimeModel(), vad=silero.VAD.load()) await session.start(room=ctx.room, agent=Assistant()) await session.generate_reply() if name == "__main__": agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
t
Thanks for reaching out, ZaidKaraymeh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
c
EG_5BoYiSnT8ANi Jul 28, 2025, 103347 pm13 min Starting Room composite test its stuck status as Starting