limited-dawn-94551
10/20/2025, 10:42 AMtall-airline-16756
10/20/2025, 10:42 AMtall-airline-16756
10/20/2025, 10:45 AMMediaDeviceFailure.getFailure(error) to spot issues like PermissionDenied, NotFound, or DeviceInUse.
• Verify Audio Device Availability: It’s a good idea to list all available devices with uv run list_devices.py to ensure your devices are recognized.
• Browser Restrictions: If you're using a browser, remember that audio playback often needs to be triggered by a user action. Try using Room.startAudio inside a click or tap handler to help with this.
• Optimize Audio Settings: Enabling background noise cancellation and echo cancellation can really improve your audio quality.
• Debugging: For a closer look at what might be going wrong, you can enable debug logging by running uv run stream_audio.py --debug. This can highlight specific issues.
If you’re still having trouble, it would be great if you could share a bit more about your situation, like:
• The exact error messages or symptoms you’re seeing
• Your agent configuration (are you using Python or JavaScript?)
• Whether the problem happens right when you start up or later during use
• Your hardware setup and operating system details
With this info, I’ll be able to guide you more precisely. I’m here to help, so don’t hesitate to reach out!
Sources: livekit-agents/livekit/agents/voice/agent_session.py | Agent speech and audio | LiveKit Docs | README.md | Resolving "InvalidState - failed to capture frame" errors in AudioSource | SIP troubleshooting guide | LiveKit Docslimited-dawn-94551
10/20/2025, 10:51 AMtall-airline-16756
10/20/2025, 10:52 AMfrom livekit.rtc import AudioProcessingModule
apm = AudioProcessingModule(
echo_cancellation=True,
noise_suppression=True,
auto_gain_control=True
)
• For JavaScript:
const audioOptions = {
echoCancellation: true,
noiseSuppression: true
};
• For Android:
val audioOptions = LocalAudioTrackOptions(
noiseSuppression = true,
echoCancellation = true,
autoGainControl = true
)
• For iOS:
let audioCaptureOptions = AudioCaptureOptions(
echoCancellation: true,
noiseSuppression: true
)
• Enhanced Noise Cancellation (LiveKit Cloud): If you're looking for even better results, you might want to try advanced models like Background Voice Cancellation (BVC). Here's how you can set it up in Python:
from livekit.plugins import noise_cancellation
session = AgentSession(
room_input_options=RoomInputOptions(
noise_cancellation=noise_cancellation.BVC(),
)
)
If you have any questions or need a hand with the implementation, please don’t hesitate to reach out. I’m here to help you get everything working smoothly!
Sources: livekit-android-sdk/src/main/java/io/livekit/android/room/track/LocalAudioT... | livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.pyi | Enhanced noise cancellation | LiveKit Docs | SIP troubleshooting guide | LiveKit Docs | Noise & echo cancellation | LiveKit Docslimited-dawn-94551
10/20/2025, 10:54 AMtall-airline-16756
10/20/2025, 10:56 AMlimited-dawn-94551
10/20/2025, 10:56 AMtall-airline-16756
10/20/2025, 10:56 AMlimited-dawn-94551
10/20/2025, 10:57 AM