Skip to content

Conversation

@LluisV
Copy link

@LluisV LluisV commented Dec 10, 2025

Problem

Audio capture on Meta Quest devices fails with:
LiveKit: Audio capture failed: an RtcError occured: InvalidState - sample_rate and num_channels don't match

This occurs because the audio source uses hardcoded default sample rates that don't match what the device actually provides.

Solution

Make RtcAudioSource and MicrophoneSource accept optional sampleRate and channels parameters at runtime instead of relying on hardcoded platform defaults. This allows configuration to match device capabilities.

Changes

  • RtcAudioSource: Add optional uint? sampleRate parameter to constructor with intelligent fallback to platform defaults
  • MicrophoneSource: Add optional channels and sampleRate parameters to constructor (defaults: 2 channels, 48000 Hz)
  • Both now pass actual sample rate to Microphone.Start() instead of DefaultMicrophoneSampleRate

Notes

  • Tested only on version 1.2.6

Fix audio capture failures on Meta Quest devices caused by sample_rate
and num_channels mismatch with hardcoded defaults.

Changes:
- RtcAudioSource: Add optional uint? sampleRate parameter with platform-specific fallbacks
- MicrophoneSource: Accept configurable channels and sampleRate at runtime
- Allows device-specific audio configuration to match actual capabilities

Fixes: InvalidState error - sample_rate and num_channels don't match
@CLAassistant
Copy link

CLAassistant commented Dec 10, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants