-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Summary
Been tacking a severe issue with LiveKit on an upgraded project using Unity 6.3. The solution was working in 6.2 with the Audio setting set as Mono, but in 6.3 the console was flooded with the following error, which also resulted in a crash on device:
"LiveKit: Audio capture failed: an RtcError occured: InvalidState - sample_rate and num_channels don't match"
The error was completely unhelpful and difficult to diagnose, mainly due to the solution working previously and no changes being made.
Solution
Eventually after many hours of logging and diagnosing, it was down to the Unity "Default Speaker Mode" being set to "Mono", changing this to "Stereo" resolved the issues
Unity -> Edit -> Project Settings -> Audio -> Default Speaker Mode
Resolution
The error reported needs to be A LOT MORE descriptive, highlighting WHAT the actual difference and not a random error. Stating something like:
- Bit Rate from microphone does not match expected output: inputval / outputval, please update to match
- Microphone is capturing Stereo but the audio output is set to Mono, please align to avoid issues
But also, the solution should not fail this badly because of a Stereo to Mono conversion, it should be safely handled as it is not a regular error!