From b52fa9a01dcb9ad7164bcde88656afb7fce52f19 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Mon, 30 Jun 2025 09:20:02 +0800 Subject: [PATCH] fix: fix sample rate bug for Android on Unity 6000 or newer. --- Runtime/Scripts/RtcAudioSource.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/RtcAudioSource.cs b/Runtime/Scripts/RtcAudioSource.cs index ef51273..27bbde7 100644 --- a/Runtime/Scripts/RtcAudioSource.cs +++ b/Runtime/Scripts/RtcAudioSource.cs @@ -32,8 +32,8 @@ public abstract class RtcAudioSource : IRtcSource, IDisposable /// public abstract event Action AudioRead; -#if UNITY_IOS && !UNITY_EDITOR - // iOS microphone sample rate is 24k +#if (UNITY_IOS || (UNITY_ANDROID && UNITY_6000_0_OR_NEWER)) && !UNITY_EDITOR + // iOS/Android(Unity 6000+) microphone sample rate is 24k public static uint DefaultMicrophoneSampleRate = 24000; public static uint DefaultSampleRate = 48000;