helpful-salesclerk-10483
08/01/2025, 1:04 PMAgentSession with audio disabled (text-only interaction first), but the agent doesn’t reply to the first text message. Here's the relevant setup:
python
> session = AgentSession(
> stt=deepgram.STT(),
> llm=llm,
> tts=google.TTS(
> gender="female",
> voice_name="en-US-Chirp-HD-F",
> ),
> vad=silero.VAD.load(min_silence_duration=1.0),
> allow_interruptions=False,
> )
>
> session.input.set_audio_enabled(userdata.audio_enabled)
> session.output.set_audio_enabled(userdata.audio_enabled)
When userdata.audio_enabled = False, I expect it to respond via text (no voice input/output), but the first text message gets no reply.
@ctx.room.local_participant.register_rpc_method("toggle_audio")
def on_toggle_audio(data: rtc.RpcInvocationData) -> None:
session.input.set_audio_enabled(not session.input.audio_enabled)
session.output.set_audio_enabled(not session.output.audio_enabled)
…then send a message, the agent replies properly.
✅ So toggling fixes it — but only after the first failed attempt.
❓Why doesn't the agent respond to text input when the session is first initialized with audio disabled?
Any advice on initializing a voice-capable session that starts in "text-only" mode?
#livekit #agentsjolly-air-155
08/01/2025, 2:16 PMsession.input.set_audio_enabled(False) after session.start or after the RoomIO manually set.