sparse-napkin-34305
12/18/2025, 9:58 AMsession.input.audio.enabled = false just mute the mic, or does it fully stop audio frames from being sent to the STT pipeline (e.g., Deepgram)?tall-airline-16756
12/18/2025, 9:58 AMtall-airline-16756
12/18/2025, 9:58 AMsession.input.audio.enabled = false just mutes the mic or completely stops audio frames from reaching the STT pipeline.
Setting session.input.audio.enabled = false fully stops audio frames from being sent to the STT pipeline (e.g., Deepgram). Audio input is disabled at the agent level, so no audio data is forwarded for transcription or downstream processing.
If you need, I can explain the difference between this and SDK-level mic muting (e.g., setMicrophoneEnabled(false)) and when to use each.
Sources: Text and transcriptions | LiveKit docssparse-napkin-34305
12/18/2025, 10:00 AMtall-airline-16756
12/18/2025, 10:00 AMsession.input.set_audio_enabled(false)
• Observe STT events (e.g., INTERIM_TRANSCRIPT, FINAL_TRANSCRIPT, SpeechEvent). If no transcript events arrive after disabling, STT is not receiving audio.
2) Log incoming audio frames
• In your audio capture/agent code, log or count audio frames pushed to the STT stream (e.g., calls to stt_stream.push_frame() or your audio loop). When mic is disabled, the frame count should stop increasing.
3) Check STT provider activity/metrics
• Inspect provider-side activity or LiveKit STT metrics (metrics_collected, eou_metrics_collected). If metrics or provider stream activity stop after disabling audio, streaming has stopped.
4) Use voice-activity indicators
• Watch for START_OF_SPEECH / END_OF_SPEECH or VAD signals. After disabling audio, no start-of-speech events should be emitted.
Suggested quick test sequence
1. Start a session with STT enabled and confirm live transcripts appear.
2. Call session.input.set_audio_enabled(false).
3. Speak into the microphone and watch:
◦ Transcript events (should stop),
◦ Logged push_frame() counts (should stay at zero),
◦ Provider metrics (should stop).
If you tell me which SDK/environment you’re using (agent vs standalone, language/runtime, or which STT provider), I can give a short code snippet for logging frames or checking events.
Sources: Speech-to-text (STT) models | LiveKit Docs | Text and transcriptions | LiveKit docs | STT Metrics | LiveKit docssparse-napkin-34305
12/18/2025, 10:01 AMtall-airline-16756
12/18/2025, 10:02 AMsession.input.audio.enabled = false.
The agent pre-establishes the STT connection when the session starts because the STT provider is configured on the AgentSession. This reduces latency so the agent can begin transcribing immediately if audio is enabled later. However, opening the connection does not mean audio is sent—when you call session.input.set_audio_enabled(false) no audio frames are forwarded to Deepgram and no transcripts are produced.
If you want, I can:
• Show how to confirm this with a quick event/log check for transcript or push_frame() activity, or
• Provide a short code snippet for your environment to log frame pushes or STT events. Which would help most? Sources: Deepgram STT plugin guide | LiveKit docs | ElevenLabs Change Language | LiveKit docs | Text and transcriptions | LiveKit docssparse-napkin-34305
12/18/2025, 10:04 AMtall-airline-16756
12/18/2025, 10:04 AM<http://logger.info|logger.info>("Audio input disabled")
session.input.set_audio_enabled(False)
2) Log received audio frames before STT
• In your audio processing loop, log each frame before pushing to STT:
async for frame_event in audio_stream:
<http://logger.info|logger.info>("Audio frame received: %s samples", frame_event.frame.samples_per_channel)
stt_stream.push_frame(frame_event.frame) # log before this call
• After disabling, you should see no "Audio frame received" logs.
3) Log STT push calls
• Add an explicit log when you push frames:
<http://logger.info|logger.info>("Pushing audio frame to STT")
stt_stream.push_frame(frame)
• If mic is disabled, "Pushing audio frame to STT" logs should stop.
4) Log STT transcript events
• Log INTERIM/FINAL transcripts:
if event.type == SpeechEventType.INTERIM_TRANSCRIPT:
<http://logger.info|logger.info>("STT Interim: %s", text)
elif event.type == SpeechEventType.FINAL_TRANSCRIPT:
<http://logger.info|logger.info>("STT Final: %s", text)
• No transcript logs should appear while input is disabled.
5) Optional: Log provider/metrics events
• Log metrics_collected / eou_metrics_collected or provider connection state. Metrics for audio activity should stop when audio is disabled.
Quick test sequence
1. Enable audio, confirm logs show frames, pushes, and transcripts.
2. Call session.input.set_audio_enabled(False) and log that action.
3. Speak — verify that:
◦ No "Audio frame received" logs appear,
◦ No "Pushing audio frame to STT" logs appear,
◦ No transcript logs appear,
◦ Provider metrics for audio stop.
If you tell me which SDK/language (agent vs standalone, Python/Node/etc.), I’ll provide a focused snippet you can drop into your code.
Sources: Text and transcriptions | LiveKit docs | Agent-assisted warm transfer | LiveKit docs | Job lifecycle | LiveKit docs | STT Metrics | LiveKit docssparse-napkin-34305
12/18/2025, 11:03 AMtall-airline-16756
12/18/2025, 11:03 AMrecoverable flag) you can listen for to detect usage/limit errors and act.
What to do (high-level):
• Listen for the AgentSession ErrorEvent.
• On a non-recoverable/usage-limit error, stop/skip starting the avatar worker and ensure the agent publishes audio directly to the room.
• Keep STT/TTS and agent logic running so voice interaction continues.
If you want, I can provide:
• A short code pattern (node or python) to detect the error and toggle avatar vs voice-only routing, or
• Specific log/flag checks to decide recoverable vs non-recoverable errors. Which would you prefer? Sources: examples/avatar_agents | livekit/livekit_composite | DeepWiki | Virtual avatar plugins | LiveKit Docs | Events and error handling | LiveKit docs