You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure native audio source from device config instead of hardcoded defaults (#304)
* Configure native audio source from device, not hardcoded defaults
The native (Rust) audio source was created with a hardcoded sample rate
(48000) and channel count (2). Microphone frames flow through Unity's
audio graph (AudioProbe) at the actual DSP output configuration, which
often differs — e.g. with a Bluetooth headset. The Rust source does not
resample; it rejects frames whose rate/channels don't match, causing the
metadata-mismatch warning and capture failures.
Read the source's sample rate and channel count from Unity's output
configuration (AudioSettings.GetConfiguration) instead of hardcoded
defaults, falling back to the defaults only when Unity can't report one.
The base constructor now exposes a device-mode overload (type only) and an
explicit overload (type, sampleRate, channels) for sources that generate a
fixed format. MicrophoneSource and BasicAudioSource use device mode;
BasicAudioSource drops its unused channels parameter. SineWaveAudioSource
declares its exact format.
If a frame's format still doesn't match (inconsistent Unity report or a
runtime output change), drop it with a throttled warning instead of
sending a mismatch the native side would error on. Also removes the
redundant Microphone.Start in the Meet sample.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove logging changes
* Adds microphone start again for iOS, adds a debug log
* Trust Unity audio selection, use sample rate detected in mic start
0 commit comments