My agent doesn't seem to be receiving audio input ...
# ask-ai
c
My agent doesn't seem to be receiving audio input through the playground or telephony. I can interact with it via text in the playground, but it doesn't recognize audio despite the microphone working. What might be causing this?
t
Thanks for reaching out, Duncan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you figure out why your agent might not be receiving audio input through the playground or telephony. Let's walk through some steps together to troubleshoot this: • Audio Input Configuration: First, please double-check that audio input is enabled in your agent's configuration. For instance, in
RoomInputOptions
, make sure
audio_enabled=True
is set. • Playground-Specific Issues: Take a look at the audio visualizer in the playground to see if it’s picking up your microphone input. If it’s not, it might be worth checking your microphone permissions and ensuring your hardware is working properly. • Telephony-Specific Issues: Confirm that your SIP configuration is correct and that your agent is set up to accept telephony participants. • Browser Audio Issues: Keep an eye out for any warnings like "silence detected on local audio track" in your browser console, as these can sometimes point to noise suppression settings or permission problems. • Testing: You might find it helpful to try running your agent in terminal mode (
python myagent.py console
) or development mode (
python myagent.py dev
) to help isolate where the issue might be. If you could share a bit more about your setup—like any error messages you’re seeing, your configuration code, or how you’re testing—I’d be glad to offer more specific guidance. We’ll get this sorted out together! Sources: examples/avatar_agents/bey/README.md | Agents playground | LiveKit Docs | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Understanding "silence detected on local audio track" warning
c
There are no browser audio issues. Logging indicates the input stream source is SOURCE_UNKNOWN whereas it's expecting SOURCE_MICROPHONE
t
Thanks for reaching out! The issue with the input stream source showing as
SOURCE_UNKNOWN
instead of
SOURCE_MICROPHONE
usually happens when the track source isn’t clearly specified during track creation or publishing. Let’s walk through some helpful steps to get this sorted: • Track Creation Method: If you’re using
createTracks()
or
setMicrophoneEnabled()
, the source should automatically be set to
SOURCE_MICROPHONE
. Double-check that you’re using these methods for your microphone input. • Manual Track Publishing: When you’re publishing tracks manually, make sure to explicitly set the source to
Track.Source.Microphone
during publishing. • Custom Audio Sources: If you’re working with custom audio sources like WebAudio streams, seeing
SOURCE_UNKNOWN
is actually expected and perfectly okay. • Fallback Logic: Even if the source is
SOURCE_UNKNOWN
, LiveKit has fallback logic to recognize audio tracks as potential microphone sources. To help you better, could you please share a bit more about: • How you’re creating the audio track (for example, using
createTracks
,
getUserMedia
, WebAudio, etc.) • How you’re publishing it (like with
setMicrophoneEnabled
,
publishTrack
, etc.) • Whether this is an actual microphone input or a custom audio source With these details, I’ll be able to guide you more precisely. Looking forward to your reply!
c
This is an actual microphone source. I'm not doing anything special, just creating an agent and using
session.start
with
room_input_options=RoomInputOptions(audio_enabled=True)
t
It sounds like the issue with the input stream source showing as
SOURCE_UNKNOWN
instead of
SOURCE_MICROPHONE
might be related to a configuration conflict or how the audio input is set up. Let’s walk through a few steps that could help resolve this: • Use Default Configuration: Instead of explicitly setting
audio_enabled=True
, try using
RoomInputOptions()
without specifying
audio_enabled
. This approach uses the default behavior, which tends to work reliably. • Check for Configuration Conflicts: Double-check that you’re not setting both RoomIO audio and session audio input/output at the same time, as this can sometimes cause issues. • Verify Track Source: If you do need to explicitly configure audio, please ensure the
audio_publish_options
uses
TrackSource.SOURCE_MICROPHONE
. • Session Setup Order: It’s important to complete all audio configurations before calling
session.start
. Here’s an example of a configuration that works well:
Copy code
await session.start(
    agent=WeatherAgent(),
    room=ctx.room,
    room_input_options=RoomInputOptions(),
    room_output_options=RoomOutputOptions(transcription_enabled=True),
)
If you’re still running into trouble, could you please let me know if you’re setting up any audio input/output outside of
RoomInputOptions
? Or, if you’re comfortable sharing your full
session.start
call, that would be really helpful for me to assist you further. Sources: examples/voice_agents/realtime_video_agent.py | agent/main.py | observability/roomobs/room.go
c
This is the full call:
Copy code
async def entrypoint(ctx: agents.JobContext):
    session = AgentSession(
        vad=silero.VAD.load(),
        stt=deepgram.STTv2(model="flux-general-en", eager_eot_threshold=0.4, api_key=DEEPGRAM_API_KEY),
        # stt=deepgram.STT(model="nova-3-general"),
        llm=anthropic.LLM(model="claude-sonnet-4-20250514", api_key=ANTHROPIC_API_KEY),
        tts=deepgram.TTS(model="aura-2-theia-en", api_key=DEEPGRAM_API_KEY),
        # allow the LLM to generate a response while waiting for the end of turn
        # this works with Flux's EagerEndOfTurn events to start LLM generation earlier
        preemptive_generation=True,
        # sometimes background noise could interrupt the agent session, these are considered false positive interruptions
        # when it's detected, you may resume the agent's speech
        resume_false_interruption=True,
    )

    await session.start(
        room=ctx.room,
        agent=Assistant(),
        room_input_options=RoomInputOptions(),
        room_output_options=RoomOutputOptions(transcription_enabled=True),
    )
t
Thank you so much for sharing the full call details. Based on what you’ve shared, it looks like the issue might be related to the default behavior of
RoomInputOptions()
. While it’s designed to work smoothly, let’s walk through a few steps together to make sure your audio input is set up just right: • Default Behavior: When you use
RoomInputOptions()
without explicitly setting
audio_enabled
, it should automatically enable audio input. This matches how it works in other successful examples. • Verify Track Source: It’s a good idea to double-check that your audio track source is correctly identified as
SOURCE_MICROPHONE
. If it’s not, there might be a hiccup with how the audio track is being created. • Test with Explicit Configuration: To be sure, try setting
audio_enabled=True
explicitly in
RoomInputOptions
and see if that helps. Here’s how you can do it:
Copy code
await session.start(
    room=ctx.room,
    agent=Assistant(),
    room_input_options=RoomInputOptions(audio_enabled=True),
    room_output_options=RoomOutputOptions(transcription_enabled=True),
)
If you still run into issues after this, don’t worry—we can dig a little deeper into how the audio track is created and published. Please feel free to share any specific errors or unusual behavior you notice after trying this, and I’ll be here to help you through it!