:white_check_mark: Audio track detected :white_che...
# ask-ai
m
✅ Audio track detected ✅ Track subscribed successfully ❌ ZERO 🎵 [FRAME 1] Audio frame received! logs The @session.on(“audio_frames_received”) event is never firing. Track subscription works but AgentSession isn’t receiving frames. The core problem is crystal clear: • AgentSession has NO audio input stream (_audio_stream = False) • This happens regardless of VAD type (custom Silero vs default LiveKit) • This happens regardless of RoomInputOptions(audio_enabled=True) • This happens regardless of turn_detection=“vad” why would the agent not be receiving the audio? any ideas where to focus next?
t
Thanks for reaching out, Pablo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let’s take a look at some possible reasons why the AgentSession isn’t receiving audio frames, even though the track subscription seems successful: • Audio Stream Initialization: Make sure the agent actually creates an
AudioStream
from the subscribed track. This is a key step to start getting those audio frames. • Track Type Verification: Double-check that the subscribed track is of type
TrackKind.KIND_AUDIO
. If it’s not, the agent might be missing out on valid audio streams. • Audio Configuration: Confirm that the
AudioStream
is set up with the right sample rate and number of channels to match the track’s settings. • Audio Processing Settings: Take a look at noise cancellation or other audio processing options—if they’re on but not configured correctly, they might be blocking the audio frames. • Source Filtering: If the agent is filtering for specific sources like
SOURCE_MICROPHONE
, make sure the subscribed track matches what’s expected. • Asynchronous Task Management: Check that the task reading from the
AudioStream
iterator is actually running and hasn’t been stopped too soon. Going through these should help pinpoint what’s going on. If you want, I’m here to help you dig into any of these points! Sources: Speech & Audio Processing | livekit/livekit_composite | DeepWiki | stream_audio.py | Receiving and publishing tracks | LiveKit Docs | Audio and video | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_session.py